Package com.enterprisedt.util.proxy
Class ProxyServerSocket
java.lang.Object
com.enterprisedt.util.proxy.ProxyServerSocket
- Direct Known Subclasses:
SSLProxyServerSocket
Supports no proxy or SOCKS proxies. HTTP proxies not supported (as they
can't do active mode).
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InetAddressprotected ProxySettingsprotected intprotected intprotected StreamServerSocketprotected SocksProxySocketprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccept a connectionvoidbind(int port, InetAddress addr) Bind server socket to a port to listen onvoidclose()Close the socketintintGets the value of SO_RCVBUFintGet value of the SO_SNDBUF optionprotected StreamServerSocketintReturns setting for SO_TIMEOUT.voidsetLocalAddress(InetAddress addr) voidsetReceiveBufferSize(int size) Sets the SO_RCVBUF optionvoidsetSendBufferSize(int size) Sets the SO_SNDBUF optionvoidsetSoTimeout(int timeout) Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
-
Field Details
-
proxySettings
-
serverSocket
-
socksSocket
-
localAddress
-
timeout
protected int timeout -
receivesize
protected int receivesize -
sendsize
protected int sendsize
-
-
Constructor Details
-
ProxyServerSocket
-
-
Method Details
-
getLocalPort
public int getLocalPort() -
getLocalAddress
- Throws:
IOException
-
setLocalAddress
-
setSoTimeout
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.- Parameters:
timeout-- Throws:
SocketExceptionIOException
-
getSoTimeout
Returns setting for SO_TIMEOUT.- Throws:
IOException
-
getReceiveBufferSize
Gets the value of SO_RCVBUF- Throws:
SocketException
-
setReceiveBufferSize
Sets the SO_RCVBUF option- Throws:
SocketException
-
setSendBufferSize
Sets the SO_SNDBUF option- Throws:
SocketException
-
getSendBufferSize
Get value of the SO_SNDBUF option- Throws:
SocketException
-
bind
Bind server socket to a port to listen on- Parameters:
port-addr-- Throws:
IOException
-
getServerSocket
- Throws:
IOException
-
acceptConnection
Accept a connection- Returns:
- Throws:
IOException
-
close
Close the socket- Throws:
IOException
-