mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-02 08:50:26 +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();
|
private static final Random RANDOM = new Random();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
if (Options.ONLINE_MODE) {
|
KEY_PAIR = CryptUtil.generateKeyPair();
|
||||||
KEY_PAIR = CryptUtil.generateKeyPair();
|
|
||||||
} else {
|
|
||||||
KEY_PAIR = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProxyConnection proxyConnection;
|
private ProxyConnection proxyConnection;
|
||||||
@ -88,7 +84,7 @@ public class Client2ProxyHandler extends SimpleChannelInboundHandler<IPacket> {
|
|||||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
super.channelActive(ctx);
|
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());
|
this.proxyConnection = new ProxyConnection(Proxy2ServerHandler::new, Proxy2ServerChannelInitializer::new, (SocketChannel) ctx.channel());
|
||||||
ctx.channel().attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY).set(this.proxyConnection);
|
ctx.channel().attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY).set(this.proxyConnection);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user