Search in sources :

Example 1 with Socks4CommandStatus

use of io.netty.handler.codec.socksx.v4.Socks4CommandStatus in project netty by netty.

the class Socks4ProxyHandler method handleResponse.

@Override
protected boolean handleResponse(ChannelHandlerContext ctx, Object response) throws Exception {
    final Socks4CommandResponse res = (Socks4CommandResponse) response;
    final Socks4CommandStatus status = res.status();
    if (status == Socks4CommandStatus.SUCCESS) {
        return true;
    }
    throw new ProxyConnectException(exceptionMessage("status: " + status));
}
Also used : Socks4CommandStatus(io.netty.handler.codec.socksx.v4.Socks4CommandStatus) Socks4CommandResponse(io.netty.handler.codec.socksx.v4.Socks4CommandResponse)

Aggregations

Socks4CommandResponse (io.netty.handler.codec.socksx.v4.Socks4CommandResponse)1 Socks4CommandStatus (io.netty.handler.codec.socksx.v4.Socks4CommandStatus)1