mirror of
https://github.com/raz-varren/sacrificial-socket.git
synced 2025-12-24 12:38:09 +08:00
removed deprecated SocketServer.WebHandler() method from examples
This commit is contained in:
@@ -47,7 +47,7 @@ func main() {
|
|||||||
s := ss.NewServer()
|
s := ss.NewServer()
|
||||||
s.On("echo", doEcho)
|
s.On("echo", doEcho)
|
||||||
|
|
||||||
http.Handle("/socket", s.WebHandler())
|
http.Handle("/socket", s)
|
||||||
http.ListenAndServe(":8080", nil);
|
http.ListenAndServe(":8080", nil);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ func main() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
http.Handle("/socket", s.WebHandler())
|
http.Handle("/socket", s)
|
||||||
http.Handle("/", http.FileServer(http.Dir("webroot")))
|
http.Handle("/", http.FileServer(http.Dir("webroot")))
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func main() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
http.Handle("/socket", s.WebHandler())
|
http.Handle("/socket", s)
|
||||||
http.Handle("/", http.FileServer(http.Dir("webroot")))
|
http.Handle("/", http.FileServer(http.Dir("webroot")))
|
||||||
|
|
||||||
if *cert == "" || *key == "" {
|
if *cert == "" || *key == "" {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ func main() {
|
|||||||
s.On("join", join)
|
s.On("join", join)
|
||||||
s.On("message", message)
|
s.On("message", message)
|
||||||
|
|
||||||
http.Handle("/socket", s.WebHandler())
|
http.Handle("/socket", s)
|
||||||
http.Handle("/", http.FileServer(http.Dir("webroot")))
|
http.Handle("/", http.FileServer(http.Dir("webroot")))
|
||||||
|
|
||||||
log.Err.Fatalln(http.ListenAndServe(":80", nil))
|
log.Err.Fatalln(http.ListenAndServe(":80", nil))
|
||||||
|
|||||||
Reference in New Issue
Block a user