ProxyRequest request = proxyIoSession.getRequest();
if (request instanceof SocksProxyRequest) {
SocksProxyRequest req = (SocksProxyRequest) request;
if (req.getProtocolVersion() == SocksProxyConstants.SOCKS_VERSION_4) {
handler = new Socks4LogicHandler(proxyIoSession);
} else {
handler = new Socks5LogicHandler(proxyIoSession);
}
} else {
handler = new HttpSmartProxyHandler(proxyIoSession);