mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2025-03-13 13:39:58 +01:00
Fixed proxy online mode not being toggleable at runtime
This commit is contained in:
parent
5395ec40c1
commit
412bcde727
@ -70,11 +70,7 @@ public class Client2ProxyHandler extends SimpleChannelInboundHandler<IPacket> {
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
static {
|
||||
if (Options.ONLINE_MODE) {
|
||||
KEY_PAIR = CryptUtil.generateKeyPair();
|
||||
} else {
|
||||
KEY_PAIR = null;
|
||||
}
|
||||
KEY_PAIR = CryptUtil.generateKeyPair();
|
||||
}
|
||||
|
||||
private ProxyConnection proxyConnection;
|
||||
@ -88,7 +84,7 @@ public class Client2ProxyHandler extends SimpleChannelInboundHandler<IPacket> {
|
||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||
super.channelActive(ctx);
|
||||
|
||||
if (Options.ONLINE_MODE) RANDOM.nextBytes(this.verifyToken);
|
||||
RANDOM.nextBytes(this.verifyToken);
|
||||
this.proxyConnection = new ProxyConnection(Proxy2ServerHandler::new, Proxy2ServerChannelInitializer::new, (SocketChannel) ctx.channel());
|
||||
ctx.channel().attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY).set(this.proxyConnection);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user