韩立刚门徒级课程专题(WS+网络安全+数据库)
2023-08-22 20:27:09
来源:哔哩哔哩
(资料图片)
新建文件,该文件为主启动程序,负责建立HTTP服务以响应客户端到
serveWebsocket
请求响应。
package mainimport ( "flag" "log" "net/http")var addr = ("addr", ":3000", "http service address")func serveHome(w , r *) { () if != "/" { (w, "Not found", ) return } if != { (w, "Method not allowed", ) return } (w, r, "public/")}