/** * Connect to a HTTP proxy. * Proxy address must be in _proxyHost and _proxyPort. * Side effects: Sets _proxy, _proxyIn, _proxyOut, * and other globals via readHeaders() * * @param port what the proxy should connect to, probably 4444 * @since 0.9.33 */ private void internalHttpProxyConnect(String host, int port) throws IOException { // connect to the proxy _proxy = InternalSocket.getSocket(_proxyHost, _proxyPort); httpProxyConnect(_proxy, host, port); }
/** * Connect to a HTTP proxy. * Proxy address must be in _proxyHost and _proxyPort. * Side effects: Sets _proxy, _proxyIn, _proxyOut, * and other globals via readHeaders() * * @param host what the proxy should connect to * @param port what the proxy should connect to * @since 0.9.33 */ private void httpProxyConnect(String host, int port) throws IOException { // connect to the proxy // _proxyPort validated in superconstrutor, no need to set default here if (_fetchHeaderTimeout > 0) { _proxy = new Socket(); _proxy.setSoTimeout(_fetchHeaderTimeout); _proxy.connect(new InetSocketAddress(_proxyHost, _proxyPort), _fetchHeaderTimeout); } else { _proxy = new Socket(_proxyHost, _proxyPort); } httpProxyConnect(_proxy, host, port); }
switch (_proxyType) { case HTTP: httpProxyConnect(host, port); break;