summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/btr/proxy/selector/fixed/FixedSocksSelector.java
blob: d1f7cccc0e6a8ab3f4d6013a06dd0423e36db121 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.btr.proxy.selector.fixed;

import java.net.InetSocketAddress;
import java.net.Proxy;

/*****************************************************************************
 * This proxy selector is configured with a fixed proxy. This proxy will be 
 * returned for all URIs passed to the select method. This implementation 
 * can be used for SOCKS 4 and 5 proxy support.
 *
 * @author Bernd Rosstauscher (proxyvole@rosstauscher.de) Copyright 2009
 ****************************************************************************/

public class FixedSocksSelector extends FixedProxySelector {
	
	/*************************************************************************
	 * Constructor
	 * @param proxyHost the host name or IP address of the proxy to use.
	 * @param proxyPort the port of the proxy.
	 ************************************************************************/
	
	public FixedSocksSelector(String proxyHost, int proxyPort) {
		super(new Proxy(Proxy.Type.SOCKS, 
				InetSocketAddress.createUnresolved(proxyHost, proxyPort)));
	}

}