Package com.neovisionaries.ws.client
Class ProxyHandshaker
- java.lang.Object
-
- com.neovisionaries.ws.client.ProxyHandshaker
-
class ProxyHandshaker extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
mHost
private int
mPort
private ProxySettings
mSettings
private static java.lang.String
RN
-
Constructor Summary
Constructors Constructor Description ProxyHandshaker(java.lang.String host, int port, ProxySettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addHeaders(java.lang.StringBuilder builder)
private void
addProxyAuthorization(java.lang.StringBuilder builder)
private java.lang.String
buildRequest()
(package private) java.lang.String
getProxiedHostname()
To be able to verify the hostname of the certificate received if a connection is made to an https/wss endpoint, access to this hostname is required.void
perform(java.net.Socket socket)
private void
readStatusLine(java.io.InputStream input)
private void
receiveResponse(java.net.Socket socket)
private void
sendRequest(java.net.Socket socket)
private void
skipHeaders(java.io.InputStream input)
-
-
-
Field Detail
-
RN
private static final java.lang.String RN
- See Also:
- Constant Field Values
-
mHost
private final java.lang.String mHost
-
mPort
private final int mPort
-
mSettings
private final ProxySettings mSettings
-
-
Constructor Detail
-
ProxyHandshaker
public ProxyHandshaker(java.lang.String host, int port, ProxySettings settings)
-
-
Method Detail
-
perform
public void perform(java.net.Socket socket) throws java.io.IOException
- Throws:
java.io.IOException
-
sendRequest
private void sendRequest(java.net.Socket socket) throws java.io.IOException
- Throws:
java.io.IOException
-
buildRequest
private java.lang.String buildRequest()
-
addHeaders
private void addHeaders(java.lang.StringBuilder builder)
-
addProxyAuthorization
private void addProxyAuthorization(java.lang.StringBuilder builder)
-
receiveResponse
private void receiveResponse(java.net.Socket socket) throws java.io.IOException
- Throws:
java.io.IOException
-
readStatusLine
private void readStatusLine(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
skipHeaders
private void skipHeaders(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
getProxiedHostname
java.lang.String getProxiedHostname()
To be able to verify the hostname of the certificate received if a connection is made to an https/wss endpoint, access to this hostname is required.- Returns:
- the hostname of the server the proxy is asked to connect to.
-
-