Listen on all interfaces, this is a demo after all
This commit is contained in:
1 parent
c71ce9fc2e
commit
97ccca35f2
1 file changed
+1
-1
@@ -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