This commit is contained in:
crusader 2017-11-29 02:02:14 +09:00
parent 724ed780bf
commit 18eac21b52

View File

@ -143,16 +143,16 @@ func (s *server) handleRequest(ctx *fasthttp.RequestCtx) {
s.handleError(ctx, http.StatusNotAcceptable, fmt.Errorf("Server: Handshake err"))
return
}
logging.Logger().Debug(fmt.Sprintf("Server: Client is Handshake."))
s.upgrader.Upgrade(ctx, responseHeader, func(conn *websocket.Conn, err error) {
if err != nil {
s.handleError(ctx, fasthttp.StatusInternalServerError, err)
return
}
logging.Logger().Debug(fmt.Sprintf("Server: Client is Upgrade."))
socketCTX := socketHandler.SocketContext(s.ctx)
logging.Logger().Debug(fmt.Sprintf("Server: Client is SocketContext."))
soc := newSocket(socketHandler, socketCTX, conn, socketID)
logging.Logger().Debug(fmt.Sprintf("Server: Client[%s] is connected.", soc.RemoteAddr()))