Skip to content

Commit aa6bb7d

Browse files
committed
update README.md && add note
1 parent dbdb799 commit aa6bb7d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
2. 进入gows目录 `cd xxxx/gows`
1313
3. 启动程序 `go run main.go -debug=true -p=9000` // -debug参数指定是否将服务端日志打印出来,-p指定监听端口
1414

15+
## 容器化
16+
17+
1. 切换到此目录 ,执行 `docker build -t YourTag .`

main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ var (
2525

2626
func init() {
2727
// get cmd args
28-
flag.StringVar(&Port, "p", "9000", "listen port")
29-
flag.BoolVar(&Debug, "debug", false, "is or not debug")
28+
flag.StringVar(&Port, "p", "9000", "listen port") // if -p=8080 then listen port is 8080 not 9000
29+
flag.BoolVar(&Debug, "debug", false, "is or not debug") // if -debug=true then print interactive log
3030
flag.Parse()
3131
// init data
3232
MyConn.Data = make(map[string]*impl.Connection)
@@ -115,5 +115,7 @@ func main() {
115115
http.HandleFunc("/r/v1/ws", wsHandler)
116116
http.HandleFunc("/api/v1/ws", wsHandler)
117117
http.ListenAndServe(":"+Port, nil)
118+
119+
// you can use https
118120
// http.ListenAndServeTLS(":"+Port, "./cert.pem", "./key.pem", nil)
119121
}

0 commit comments

Comments
 (0)