public class ProxyHandshake extends Object
client => server CONNECT ws.example.com HTTP/1.1 Host: ws.example.com server => client HTTP/1.1 200 Connection established Proxy-agent:
| Constructor and Description |
|---|
ProxyHandshake(InetSocketAddress proxy,
InetSocketAddress origin,
Authenticator authenticator,
WebSocket webSocket)
Instantiates a new proxy handshake.
|
ProxyHandshake(InetSocketAddress proxy,
InetSocketAddress origin,
WebSocket webSocket)
Instantiates a new proxy handshake.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
createAuthorizeRequest(String creadectialsStr)
Creates the authorize request.
|
ByteBuffer |
createHandshakeRequest(String method,
String host)
Creates the handshake request.
|
void |
doHandshake(SocketChannel socket)
Do handshake.
|
int |
getConnectionReadTimeout()
Gets the connection read timeout.
|
InetSocketAddress |
getOriginAddress()
Gets the origin address.
|
InetSocketAddress |
getProxyAddress()
Gets the proxy address.
|
protected boolean |
parseHandshakeResponseHeader(ByteBuffer buffer)
Parses the handshake response header.
|
void |
setConnectionReadTimeout(int connectionReadTimeout)
Sets the connection read timeout.
|
protected com.taobao.api.internal.toplink.embedded.websocket.handshake.ProxyHandshake.State |
state()
State.
|
protected com.taobao.api.internal.toplink.embedded.websocket.handshake.ProxyHandshake.State |
transitionTo(com.taobao.api.internal.toplink.embedded.websocket.handshake.ProxyHandshake.State to)
Transition to.
|
public ProxyHandshake(InetSocketAddress proxy, InetSocketAddress origin, WebSocket webSocket)
proxy - the proxyorigin - the originpublic ProxyHandshake(InetSocketAddress proxy, InetSocketAddress origin, Authenticator authenticator, WebSocket webSocket)
proxy - the proxyorigin - the originauthenticator - the authenticatorprotected com.taobao.api.internal.toplink.embedded.websocket.handshake.ProxyHandshake.State transitionTo(com.taobao.api.internal.toplink.embedded.websocket.handshake.ProxyHandshake.State to)
to - the toprotected com.taobao.api.internal.toplink.embedded.websocket.handshake.ProxyHandshake.State state()
public void doHandshake(SocketChannel socket) throws WebSocketException
socket - the socketWebSocketException - the web socket exceptionpublic ByteBuffer createHandshakeRequest(String method, String host)
method - the methodhost - the hostpublic ByteBuffer createAuthorizeRequest(String creadectialsStr)
creadectialsStr - the creadectials strprotected boolean parseHandshakeResponseHeader(ByteBuffer buffer) throws WebSocketException
buffer - the bufferWebSocketException - the web socket exceptionpublic int getConnectionReadTimeout()
public void setConnectionReadTimeout(int connectionReadTimeout)
connectionReadTimeout - the new connection read timeoutpublic InetSocketAddress getProxyAddress()
public InetSocketAddress getOriginAddress()
Copyright © 2021. All rights reserved.