OnConnected added

This commit is contained in:
crusader 2017-09-20 12:56:06 +09:00
parent 59ed7df624
commit c526faeb1e

View File

@ -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) {