use of com.github.jh3nd3rs0n.jargyle.server.WorkerContext in project jargyle by jh3nd3rs0n.
the class Socks5Worker method run.
public void run() throws IOException {
this.clientFacingInputStream = this.clientFacingSocket.getInputStream();
Method method = this.negotiateMethod();
if (method == null) {
return;
}
MethodSubnegotiationResults methodSubnegotiationResults = this.doMethodSubnegotiation(method);
if (methodSubnegotiationResults == null) {
return;
}
Socket socket = methodSubnegotiationResults.getSocket();
this.clientFacingInputStream = socket.getInputStream();
this.clientFacingSocket = socket;
this.socks5WorkerContext = new Socks5WorkerContext(new WorkerContext(this.clientFacingSocket, this.socks5WorkerContext.getConfiguration(), this.socks5WorkerContext.getRoute(), this.socks5WorkerContext.getRoutes(), this.socks5WorkerContext.getClientFacingDtlsDatagramSocketFactory()));
Socks5Request socks5Request = this.newSocks5Request();
if (socks5Request == null) {
return;
}
if (!this.canAllowSocks5Request(new Socks5RequestFirewallRule.Context(this.clientFacingSocket.getInetAddress().getHostAddress(), this.clientFacingSocket.getLocalAddress().getHostAddress(), methodSubnegotiationResults, socks5Request))) {
return;
}
Route route = this.selectRoute(new Socks5RequestRoutingRule.Context(this.clientFacingSocket.getInetAddress().getHostAddress(), this.clientFacingSocket.getLocalAddress().getHostAddress(), methodSubnegotiationResults, socks5Request, this.socks5WorkerContext.getRoutes()));
if (route == null) {
return;
}
this.socks5WorkerContext = new Socks5WorkerContext(new WorkerContext(this.socks5WorkerContext.getClientFacingSocket(), this.socks5WorkerContext.getConfiguration(), route, this.socks5WorkerContext.getRoutes(), this.socks5WorkerContext.getClientFacingDtlsDatagramSocketFactory()));
Socks5RequestWorkerContext socks5RequestWorkerContext = new Socks5RequestWorkerContext(this.socks5WorkerContext, methodSubnegotiationResults, socks5Request);
Socks5RequestWorker socks5RequestWorker = this.newSocks5RequestWorker(socks5RequestWorkerContext);
socks5RequestWorker.run();
}
Aggregations