/* * @Author: your name * @Date: 2021-10-21 20:30:24 * @LastEditTime: 2021-10-22 22:49:21 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \webrtc_easy_signal\main.go */ package main import ( "fmt" "net/http" ) // 启动程序 func StartWebsocket(addrPort string) { WsConnAll = make(map[int64]*WsConnection) http.HandleFunc("/ws", WsHandler) http.ListenAndServe(addrPort, nil) } func main(){ StartWebsocket(fmt.Sprintf("0.0.0.0:9555")) }