From c526faeb1ee5444ec17a46a1022a645305c2d9b9 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 20 Sep 2017 12:56:06 +0900 Subject: [PATCH] OnConnected added --- server/server_handlers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/server_handlers.go b/server/server_handlers.go index a9213ee..3932eb7 100644 --- a/server/server_handlers.go +++ b/server/server_handlers.go @@ -33,7 +33,12 @@ type serverHandlers struct { cfg config.Configurator } -func (h *serverHandlers) OnConnection(soc ogw.Socket) { +func (h *serverHandlers) OnConnection(ctx *fasthttp.RequestCtx) bool { + + return true +} + +func (h *serverHandlers) OnConnected(soc ogw.Socket) { // tokenString := string(soc.Conn().Headers().Cookie("AuthToken")) tokenString := "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJvdmVyRmxvdyIsImlhdCI6MTUwNDU5NTExOSwiZXhwIjoxNTM2MTMxMTE5LCJhdWQiOiJ3d3cub3ZlcmZsb3cuY2xvdWQiLCJzdWIiOiJvdmVyZmxvd0Bsb2FmbGUuY29tIn0.-WQi3OykPlJ9x8RcZGhWXEtGw4GhU6wmyJ_AWh2rMeUatQylfPzvmum2Xfp6pwKLMmcP76XoDPNyq06i7RKWNQ" token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {