public class WebSocketConnectOptions extends RequestOptions
HttpClient connect a WebSocket.| Modifier and Type | Field and Description | 
|---|---|
static List<String> | 
DEFAULT_SUB_PROTOCOLS
The default WebSocket sub protocols =  
null | 
static WebsocketVersion | 
DEFAULT_VERSION
The default WebSocket version =  
WebsocketVersion.V13 | 
DEFAULT_HOST, DEFAULT_PORT, DEFAULT_SSL, DEFAULT_URI| Constructor and Description | 
|---|
WebSocketConnectOptions()  | 
WebSocketConnectOptions(JsonObject json)  | 
WebSocketConnectOptions(RequestOptions other)  | 
WebSocketConnectOptions(WebSocketConnectOptions other)  | 
| Modifier and Type | Method and Description | 
|---|---|
WebSocketConnectOptions | 
addHeader(String key,
         String value)
Add a request header. 
 | 
WebSocketConnectOptions | 
addSubProtocol(String subprotocol)
Add a WebSocket sub protocol to use. 
 | 
List<String> | 
getSubProtocols()  | 
WebsocketVersion | 
getVersion()  | 
WebSocketConnectOptions | 
setHeaders(MultiMap headers)
Set request headers from a multi-map. 
 | 
WebSocketConnectOptions | 
setHost(String host)
Set the host name to be used by the client request. 
 | 
WebSocketConnectOptions | 
setPort(int port)
Set the port to be used by the client request. 
 | 
WebSocketConnectOptions | 
setSsl(Boolean ssl)
Set whether SSL/TLS is enabled 
 | 
WebSocketConnectOptions | 
setSubProtocols(List<String> subProtocols)
Set the WebSocket sub protocols to use. 
 | 
WebSocketConnectOptions | 
setURI(String uri)
Set the request relative URI 
 | 
WebSocketConnectOptions | 
setVersion(WebsocketVersion version)
Set the WebSocket version. 
 | 
JsonObject | 
toJson()  | 
getHeaders, getHost, getPort, getURI, isSslpublic static final WebsocketVersion DEFAULT_VERSION
WebsocketVersion.V13public WebSocketConnectOptions()
public WebSocketConnectOptions(WebSocketConnectOptions other)
public WebSocketConnectOptions(RequestOptions other)
public WebSocketConnectOptions(JsonObject json)
public WebsocketVersion getVersion()
public WebSocketConnectOptions setVersion(WebsocketVersion version)
public List<String> getSubProtocols()
null if there are nonepublic WebSocketConnectOptions setSubProtocols(List<String> subProtocols)
public WebSocketConnectOptions addSubProtocol(String subprotocol)
public WebSocketConnectOptions setHost(String host)
RequestOptionssetHost in class RequestOptionspublic WebSocketConnectOptions setPort(int port)
RequestOptionssetPort in class RequestOptionspublic WebSocketConnectOptions setSsl(Boolean ssl)
RequestOptionssetSsl in class RequestOptionsssl - true if enabledpublic WebSocketConnectOptions setURI(String uri)
RequestOptionssetURI in class RequestOptionsuri - the relative uripublic WebSocketConnectOptions addHeader(String key, String value)
RequestOptionsaddHeader in class RequestOptionskey - the header keyvalue - the header valuepublic WebSocketConnectOptions setHeaders(MultiMap headers)
RequestOptionssetHeaders in class RequestOptionsheaders - the headerspublic JsonObject toJson()
toJson in class RequestOptionsCopyright © 2020 Eclipse. All rights reserved.