websocket base and command parser
This commit is contained in:
@@ -90,6 +90,14 @@ func (server *ApiServer) loadEndpoints() {
|
||||
c.AbortWithStatus(http.StatusBadRequest)
|
||||
}
|
||||
})
|
||||
|
||||
server.engine.Any("/ws", func(c *gin.Context) {
|
||||
err := server.ws.Handle(c.Writer, c.Request)
|
||||
if err != nil {
|
||||
log.Printf("Error handing websocket connection from %s: %v", c.RemoteIP(), err)
|
||||
c.AbortWithStatus(http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type ServerInfo struct {
|
||||
|
||||
Reference in New Issue
Block a user