类 WebSocketVerifyHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
com.iohao.game.external.core.netty.handler.ws.WebSocketVerifyHandler
- 所有已实现的接口:
UserSessionsAware
,io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class WebSocketVerifyHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
implements UserSessionsAware
WebSocket 连接前的 token 验证 handler
- 作者:
- 渔民小镇
- 日期:
- 2023-08-03
-
嵌套类概要
从接口继承的嵌套类/接口 io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明void
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) void
setUserSessions
(UserSessions<?, ?> userSessions) 框架会调用此方法,将 UserSessions 对象传入protected boolean
verify
(SocketUserSession userSession, Map<String, String> params) verify从类继承的方法 io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
从类继承的方法 io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
字段详细资料
-
userSessions
-
-
构造器详细资料
-
WebSocketVerifyHandler
public WebSocketVerifyHandler()
-
-
方法详细资料
-
setUserSessions
从接口复制的说明:UserSessionsAware
框架会调用此方法,将 UserSessions 对象传入- 指定者:
setUserSessions
在接口中UserSessionsAware
- 参数:
userSessions
- userSessions
-
channelRead
- 指定者:
channelRead
在接口中io.netty.channel.ChannelInboundHandler
- 覆盖:
channelRead
在类中io.netty.channel.ChannelInboundHandlerAdapter
- 抛出:
Exception
-
verify
verify- 参数:
userSession
- ctxparams
- params- 返回:
- 返回 false 表示验证没通过,框架会关闭连接
-
getParams
-