Listen on all interfaces, this is a demo after all
This commit is contained in:
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")
|
||||||
|
Reference in New Issue
Block a user