public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params)
throws IOException, UnknownHostException, ConnectTimeoutException {
InetSocketAddress socksAddr = new InetSocketAddress(socksHost, socksPort);
Proxy proxy = new Proxy(Proxy.Type.SOCKS, socksAddr);
int timeout = params.getConnectionTimeout();
Socket socket = new Socket(proxy);
socket.setSoTimeout(timeout);