socket = socketFactory.createSocket(config.getHttpProxyHost(), config.getHttpProxyPort());
connectProxy(host, port, socket);
} else {
socket = socketFactory.createSocket(host, port);
}
return new SocketConnection(socket);
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}