[{"data":1,"prerenderedAt":559},["ShallowReactive",2],{"navigation":3,"\u002Fgolang\u002Fgo_http_simple_server":144,"\u002Fgolang\u002Fgo_http_simple_server-surround":554},[4,36,53,86,131],{"title":5,"path":6,"stem":7,"children":8,"icon":35},"Golang","\u002Fgolang","1.golang\u002F1.index",[9,11,15,19,23,27,31],{"title":10,"path":6,"stem":7},"golang-各种golang学习以及使用过程中记录",{"title":12,"path":13,"stem":14},"gopls-官方gopls内置mcp server的基本使用","\u002Fgolang\u002Fgopls_mcp_usages","1.golang\u002F2.gopls_mcp_usages",{"title":16,"path":17,"stem":18},"实践-(一)创建简单的http服务器","\u002Fgolang\u002Fgo_http_simple_server","1.golang\u002F3.go_http_simple_server",{"title":20,"path":21,"stem":22},"wails入门系列(一)环境安装与demo","\u002Fgolang\u002Fwails_start","1.golang\u002F4.wails_start",{"title":24,"path":25,"stem":26},"wails入门系列(二)无边框应用的菜单栏以及窗口拖拽","\u002Fgolang\u002Fwails_frameless","1.golang\u002F5.wails_frameless",{"title":28,"path":29,"stem":30},"go\u002Fredis-redis中大数字自动转换成指数形式的处理","\u002Fgolang\u002Fredis_big_num","1.golang\u002F6.redis_big_num",{"title":32,"path":33,"stem":34},"go\u002F方法记录-局部坐标与世界坐标间的相互转换(位置\u002F方向)","\u002Fgolang\u002Fworld_local_transform","1.golang\u002F7.world_local_transform",false,{"title":37,"icon":35,"path":38,"stem":39,"children":40,"page":35},"瞎折腾","\u002Ftinkering","2.tinkering",[41,45,49],{"title":42,"path":43,"stem":44},"mi50显卡ubuntu运行大模型开坑(一)显卡准备以及驱动安装","\u002Ftinkering\u002Fmi50_gpu_llm_1","2.tinkering\u002F1.mi50_gpu_llm_1",{"title":46,"path":47,"stem":48},"mi50显卡ubuntu运行大模型开坑(二)使用llama.cpp部署Qwen3系列","\u002Ftinkering\u002Fmi50_gpu_llm_2","2.tinkering\u002F2.mi50_gpu_llm_2",{"title":50,"path":51,"stem":52},"mi50显卡ubuntu运行大模型开坑(三)安装风扇并且控制转速","\u002Ftinkering\u002Fmi50_gpu_llm_3","2.tinkering\u002F3.mi50_gpu_llm_3",{"title":54,"icon":35,"path":55,"stem":56,"children":57,"page":35},"LLM","\u002Fllm","3.llm",[58,62,66,70,74,78,82],{"title":59,"path":60,"stem":61},"langchain入门-安装以及初次使用(deepseek api版本)","\u002Fllm\u002Flangchain1","3.llm\u002F01.langchain1",{"title":63,"path":64,"stem":65},"langchain入门-使用langchain调用本地部署的大模型(以llama.cpp以及ollama为例)","\u002Fllm\u002Flangchain2","3.llm\u002F02.langchain2",{"title":67,"path":68,"stem":69},"langchain入门-使用langchain编写一个简单的聊天机器人(DeepSeek API&命令行版本)","\u002Fllm\u002Flangchain3","3.llm\u002F03.langchain3",{"title":71,"path":72,"stem":73},"langchain入门-使用langchain构建一个拥有RAG能力的代码问答应用(DeepSeek API&本地bge-m3&命令行版本)","\u002Fllm\u002Flangchain4","3.llm\u002F04.langchain4",{"title":75,"path":76,"stem":77},"golang\u002Feino eino框架的基础使用 Message以及ChatModel入门","\u002Fllm\u002Feino1","3.llm\u002F05.eino1",{"title":79,"path":80,"stem":81},"golang\u002Feino eino框架的基础使用 在ChatModel中使用工具","\u002Fllm\u002Feino2","3.llm\u002F06.eino2",{"title":83,"path":84,"stem":85},"llm\u002Fagent agent-zero初步搭建与使用","\u002Fllm\u002Fagent_zero_start","3.llm\u002F07.agent_zero_start",{"title":87,"icon":35,"path":88,"stem":89,"children":90,"page":35},"Verilog","\u002Fverilog","4.verilog",[91,95,99,103,107,111,115,119,123,127],{"title":92,"path":93,"stem":94},"31条指令单周期cpu设计(Verilog)-(一)相关软件","\u002Fverilog\u002Fmips1","4.verilog\u002F01.mips1",{"title":96,"path":97,"stem":98},"31条指令单周期cpu设计(Verilog)-(二)总体设计","\u002Fverilog\u002Fmips2","4.verilog\u002F02.mips2",{"title":100,"path":101,"stem":102},"31条指令单周期cpu设计(Verilog)-(三)指令分析","\u002Fverilog\u002Fmips3","4.verilog\u002F03.mips3",{"title":104,"path":105,"stem":106},"31条指令单周期cpu设计(Verilog)-(四)数据输入输出关系表","\u002Fverilog\u002Fmips4","4.verilog\u002F04.mips4",{"title":108,"path":109,"stem":110},"31条指令单周期cpu设计(Verilog)-(五)整体数据通路图设计","\u002Fverilog\u002Fmips5","4.verilog\u002F05.mips5",{"title":112,"path":113,"stem":114},"31条指令单周期cpu设计(Verilog)-(六)指令操作时间表设计","\u002Fverilog\u002Fmips6","4.verilog\u002F06.mips6",{"title":116,"path":117,"stem":118},"31条指令单周期cpu设计(Verilog)-(七)整体代码结构","\u002Fverilog\u002Fmips7","4.verilog\u002F07.mips7",{"title":120,"path":121,"stem":122},"31条指令单周期cpu设计(Verilog)-(八)上代码→指令译码以及控制器","\u002Fverilog\u002Fmips8","4.verilog\u002F08.mips8",{"title":124,"path":125,"stem":126},"31条指令单周期cpu设计(Verilog)-(九)上代码→基础模块实现","\u002Fverilog\u002Fmips9","4.verilog\u002F09.mips9",{"title":128,"path":129,"stem":130},"31条指令单周期cpu设计(Verilog)-(十)上代码→顶层模块设计&总结","\u002Fverilog\u002Fmips10","4.verilog\u002F10.mips10",{"title":132,"icon":35,"path":133,"stem":134,"children":135,"page":35},"Rust","\u002Frust","5.rust",[136,140],{"title":137,"path":138,"stem":139},"egui(一)从编译运行template开始","\u002Frust\u002Fegui1","5.rust\u002F01.egui1",{"title":141,"path":142,"stem":143},"egui(二)看看template的main函数：日志输出以及eframe run_native","\u002Frust\u002Fegui2","5.rust\u002F02.egui2",{"id":145,"title":16,"body":146,"description":546,"extension":547,"links":548,"meta":549,"navigation":5,"path":17,"seo":550,"stem":18,"__hash__":553},"docs\u002F1.golang\u002F3.go_http_simple_server.md",{"type":147,"value":148,"toc":538},"minimark",[149,153,187,190,228,231,451,454,498,501,512,515,534],[150,151,152],"h2",{"id":152},"说在前面",[154,155,156],"blockquote",{},[157,158,159,170,173],"ul",{},[160,161,162,163],"li",{},"实验环境：",[164,165,169],"a",{"href":166,"rel":167},"https:\u002F\u002Fblog.csdn.net\u002Fqq_33446100\u002Farticle\u002Fdetails\u002F107695641",[168],"nofollow","【go\u002Fvscode】远程环境搭建(离线版\u002Fgopls版)",[160,171,172],{},"客户端环境：chrome 84.0.4",[160,174,175,176,181,182],{},"俩本好书：",[164,177,180],{"href":178,"rel":179},"http:\u002F\u002Fbooks.studygolang.com\u002Fadvanced-go-programming-book\u002F",[168],"Go语言高级编程","、",[164,183,186],{"href":184,"rel":185},"https:\u002F\u002Fdocs.hacknode.org\u002Fgopl-zh\u002Findex.html",[168],"Go语言圣经",[150,188,189],{"id":189},"实验要求",[157,191,192],{},[160,193,194,195,218,219],{},"搭建一个简单的http服务器，可以对http请求进行响应，例如：\n",[196,197,202],"pre",{"className":198,"code":199,"language":200,"meta":201,"style":201},"language-shell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","http:\u002F\u002F127.0.0.1:8080\u002Fadd?text=123456\n","shell","",[203,204,205],"code",{"__ignoreMap":201},[206,207,210,214],"span",{"class":208,"line":209},"line",1,[206,211,213],{"class":212},"sBMFI","http:\u002F\u002F127.0.0.1:8080\u002Fadd?text",[206,215,217],{"class":216},"sfazB","=123456\n","\n页面返回\n",[196,220,222],{"className":198,"code":221,"language":200,"meta":201,"style":201},"123456\n",[203,223,224],{"__ignoreMap":201},[206,225,226],{"class":208,"line":209},[206,227,221],{"class":212},[150,229,230],{"id":230},"代码",[157,232,233],{},[160,234,235,236],{},"实验较为简单，直接上代码\n",[196,237,241],{"className":238,"code":239,"language":240,"meta":201,"style":201},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","package main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"net\u002Fhttp\"\n)\n\nfunc RecordHandler(w http.ResponseWriter, r *http.Request) {\n    values := r.FormValue(\"content\")\n    if values == \"\" {\n        fmt.Fprintf(w, \"try to use \\\"\u002Fecho?content=xxx!\\\"\")\n        return\n    }\n\n    fmt.Fprintf(w, values)\n}\n\nfunc main() {\n    mux := http.NewServeMux()\n    mux.HandleFunc(\"\u002Fecho\", RecordHandler)\n\n    server := &http.Server{\n        Addr:    \":8081\",\n        Handler: mux,\n    }\n\n    err := server.ListenAndServe()\n    if err != nil {\n        if err == http.ErrServerClosed {\n            log.Print(\"Server closed under request\")\n        } else {\n            log.Fatal(\"Server closed unexpected\")\n        }\n    }\n}\n","go",[203,242,243,248,255,261,267,273,279,285,290,296,302,308,314,320,326,331,337,343,348,354,360,366,371,377,383,389,394,399,405,411,417,423,429,435,441,446],{"__ignoreMap":201},[206,244,245],{"class":208,"line":209},[206,246,247],{},"package main\n",[206,249,251],{"class":208,"line":250},2,[206,252,254],{"emptyLinePlaceholder":253},true,"\n",[206,256,258],{"class":208,"line":257},3,[206,259,260],{},"import (\n",[206,262,264],{"class":208,"line":263},4,[206,265,266],{},"    \"fmt\"\n",[206,268,270],{"class":208,"line":269},5,[206,271,272],{},"    \"log\"\n",[206,274,276],{"class":208,"line":275},6,[206,277,278],{},"    \"net\u002Fhttp\"\n",[206,280,282],{"class":208,"line":281},7,[206,283,284],{},")\n",[206,286,288],{"class":208,"line":287},8,[206,289,254],{"emptyLinePlaceholder":253},[206,291,293],{"class":208,"line":292},9,[206,294,295],{},"func RecordHandler(w http.ResponseWriter, r *http.Request) {\n",[206,297,299],{"class":208,"line":298},10,[206,300,301],{},"    values := r.FormValue(\"content\")\n",[206,303,305],{"class":208,"line":304},11,[206,306,307],{},"    if values == \"\" {\n",[206,309,311],{"class":208,"line":310},12,[206,312,313],{},"        fmt.Fprintf(w, \"try to use \\\"\u002Fecho?content=xxx!\\\"\")\n",[206,315,317],{"class":208,"line":316},13,[206,318,319],{},"        return\n",[206,321,323],{"class":208,"line":322},14,[206,324,325],{},"    }\n",[206,327,329],{"class":208,"line":328},15,[206,330,254],{"emptyLinePlaceholder":253},[206,332,334],{"class":208,"line":333},16,[206,335,336],{},"    fmt.Fprintf(w, values)\n",[206,338,340],{"class":208,"line":339},17,[206,341,342],{},"}\n",[206,344,346],{"class":208,"line":345},18,[206,347,254],{"emptyLinePlaceholder":253},[206,349,351],{"class":208,"line":350},19,[206,352,353],{},"func main() {\n",[206,355,357],{"class":208,"line":356},20,[206,358,359],{},"    mux := http.NewServeMux()\n",[206,361,363],{"class":208,"line":362},21,[206,364,365],{},"    mux.HandleFunc(\"\u002Fecho\", RecordHandler)\n",[206,367,369],{"class":208,"line":368},22,[206,370,254],{"emptyLinePlaceholder":253},[206,372,374],{"class":208,"line":373},23,[206,375,376],{},"    server := &http.Server{\n",[206,378,380],{"class":208,"line":379},24,[206,381,382],{},"        Addr:    \":8081\",\n",[206,384,386],{"class":208,"line":385},25,[206,387,388],{},"        Handler: mux,\n",[206,390,392],{"class":208,"line":391},26,[206,393,325],{},[206,395,397],{"class":208,"line":396},27,[206,398,254],{"emptyLinePlaceholder":253},[206,400,402],{"class":208,"line":401},28,[206,403,404],{},"    err := server.ListenAndServe()\n",[206,406,408],{"class":208,"line":407},29,[206,409,410],{},"    if err != nil {\n",[206,412,414],{"class":208,"line":413},30,[206,415,416],{},"        if err == http.ErrServerClosed {\n",[206,418,420],{"class":208,"line":419},31,[206,421,422],{},"            log.Print(\"Server closed under request\")\n",[206,424,426],{"class":208,"line":425},32,[206,427,428],{},"        } else {\n",[206,430,432],{"class":208,"line":431},33,[206,433,434],{},"            log.Fatal(\"Server closed unexpected\")\n",[206,436,438],{"class":208,"line":437},34,[206,439,440],{},"        }\n",[206,442,444],{"class":208,"line":443},35,[206,445,325],{},[206,447,449],{"class":208,"line":448},36,[206,450,342],{},[150,452,453],{"id":453},"分析",[157,455,456,475,489],{},[160,457,458,459,462,463,466,467,470,471,474],{},"如果使用其他框架，例如",[203,460,461],{},"nodejs","或者基于",[203,464,465],{},"python","的",[203,468,469],{},"pyweb","，其实会发现这个构建步骤十分相似，基本上是创建服务，构建路由并绑定",[203,472,473],{},"handler","，然后开启监听。",[160,476,477,478,483,484],{},"想要了解具体的实现请参考",[164,479,482],{"href":480,"rel":481},"https:\u002F\u002Fwww.jianshu.com\u002Fp\u002F4a560e0cce22",[168],"学习用Go编写HTTP Server","以及",[164,485,488],{"href":486,"rel":487},"https:\u002F\u002Fblog.csdn.net\u002Flengyuezuixue\u002Farticle\u002Fdetails\u002F79094323",[168],"golang 构建HTTP服务",[160,490,491],{},[164,492,495],{"href":493,"rel":494},"https:\u002F\u002Fgolang.org\u002Fpkg\u002Fnet\u002Fhttp\u002F#Request",[168],[203,496,497],{},"http.Request",[150,499,500],{"id":500},"实验结果",[502,503,504,509],"p",{},[505,506],"img",{"alt":507,"src":508},"在这里插入图片描述","\u002Fgolang\u002F6.webp",[505,510],{"alt":507,"src":511},"\u002Fgolang\u002F7.webp",[150,513,514],{"id":514},"参考资料",[157,516,517,522,529],{},[160,518,519],{},[164,520,482],{"href":480,"rel":521},[168],[160,523,524],{},[164,525,528],{"href":526,"rel":527},"https:\u002F\u002Fwww.jianshu.com\u002Fp\u002F3b5c4fc0695c",[168],"Go 网络编程：使用 Handler 和 HandlerFunc",[160,530,531],{},[164,532,488],{"href":486,"rel":533},[168],[535,536,537],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":201,"searchDepth":209,"depth":250,"links":539},[540,541,542,543,544,545],{"id":152,"depth":250,"text":152},{"id":189,"depth":250,"text":189},{"id":230,"depth":250,"text":230},{"id":453,"depth":250,"text":453},{"id":500,"depth":250,"text":500},{"id":514,"depth":250,"text":514},"使用 Go 语言 net\u002Fhttp 包搭建简单 HTTP 服务器，介绍 ServeMux 路由配置、Handler 函数绑定以及 Server 结构体的基本用法。","md",null,{},{"title":551,"description":552},"【golang\u002Fhttp】实践-(一)创建简单的http服务器","使用 Go 语言 net\u002Fhttp 包搭建简单 HTTP 服务器，介绍 ServeMux 路由配置、Handler 函数绑定以及 Server 结构体的基本用法，适合 Go 语言网络编程入门学习。","yr5mTCHPpadR6pvwE9Q9e_FSLII6f-Zz2jgMmfN60Vs",[555,557],{"title":12,"path":13,"stem":14,"description":556,"children":-1},"详细介绍 gopls 内置 MCP Server 的安装配置与使用方法，包括 stdio 和 HTTP 两种运行模式、编辑器集成配置，以及 go_workspace、go_search、go_diagnostics 等核心工具的使用说明。",{"title":20,"path":21,"stem":22,"description":558,"children":-1},"Wails 桌面应用开发框架入门教程，介绍 Go、Node.js 环境配置、Wails 安装与诊断、使用 Vue+TypeScript 模板创建项目以及开发构建流程。",1776616490416]