Listen on all interfaces, this is a demo after all
This commit is contained in:
parent
c71ce9fc2e
commit
97ccca35f2
2
main.go
2
main.go
|
@ -51,7 +51,7 @@ var upgrader = websocket.Upgrader{
|
||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/ws/", subscribe)
|
http.HandleFunc("/ws/", subscribe)
|
||||||
http.HandleFunc("/", serveIndex)
|
http.HandleFunc("/", serveIndex)
|
||||||
log.Fatal(http.ListenAndServe("localhost:9888", nil))
|
log.Fatal(http.ListenAndServe("0.0.0.0:9888", nil))
|
||||||
}
|
}
|
||||||
func serveIndex(w http.ResponseWriter, r *http.Request) {
|
func serveIndex(w http.ResponseWriter, r *http.Request) {
|
||||||
f, err := os.Open("index.html")
|
f, err := os.Open("index.html")
|
||||||
|
|
Loading…
Reference in New Issue