This commit is contained in:
Gravita 2022-01-07 17:33:41 +07:00
parent 9d1118ea97
commit f7c8d03131

View file

@ -30,6 +30,10 @@ public void invoke(String... args) {
WebSocketService service = server.nettyServerSocketHandler.nettyServer.service;
service.channels.forEach((channel -> {
WebSocketFrameHandler frameHandler = channel.pipeline().get(WebSocketFrameHandler.class);
if(frameHandler == null) {
LogHelper.info("Channel %s", IOHelper.getIP(channel.remoteAddress()));
return;
}
Client client = frameHandler.getClient();
String ip = frameHandler.context.ip != null ? frameHandler.context.ip : IOHelper.getIP(channel.remoteAddress());
if (!client.isAuth)