mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
ws upgrade fail error message.
This commit is contained in:
parent
4b39607af0
commit
e1ef49c46a
@ -33,7 +33,9 @@ func New(conf *config.Server, webSocketHandler types.WebSocketHandler) *Server {
|
|||||||
router.Use(customMiddleware.Logger) // Log API request calls using custom logger function
|
router.Use(customMiddleware.Logger) // Log API request calls using custom logger function
|
||||||
|
|
||||||
router.Get("/ws", func(w http.ResponseWriter, r *http.Request) {
|
router.Get("/ws", func(w http.ResponseWriter, r *http.Request) {
|
||||||
webSocketHandler.Upgrade(w, r)
|
if webSocketHandler.Upgrade(w, r) != nil {
|
||||||
|
w.Write([]byte("unable to upgrade your connection to a websocket"))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
fs := http.FileServer(http.Dir(conf.Static))
|
fs := http.FileServer(http.Dir(conf.Static))
|
||||||
|
Loading…
Reference in New Issue
Block a user