|
|
|
@ -27,6 +27,9 @@ func wsEndpoint(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
var upgrader = websocket.Upgrader{ |
|
|
|
|
ReadBufferSize: 1024, |
|
|
|
|
WriteBufferSize: 1024, |
|
|
|
|
CheckOrigin: func(r *http.Request) bool { |
|
|
|
|
return true // DANGEROUS. USING FOR DEV PURPOSES ONLY
|
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
conn, err := upgrader.Upgrade(w, r, nil) |
|
|
|
@ -36,6 +39,8 @@ func wsEndpoint(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.Println(r.RemoteAddr) |
|
|
|
|
|
|
|
|
|
for { |
|
|
|
|
messageType, p, err := conn.ReadMessage() |
|
|
|
|
if err != nil { |
|
|
|
@ -48,7 +53,6 @@ func wsEndpoint(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fmt.Fprintf(w, "hello") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func setupRoutes() { |
|
|
|
|