public final class WebsocketClientTransport extends Object implements io.rsocket.transport.ClientTransport
ClientTransport that connects to a ServerTransport over
WebSocket.| Modifier and Type | Method and Description |
|---|---|
Mono<io.rsocket.DuplexConnection> |
connect() |
static WebsocketClientTransport |
create(reactor.netty.http.client.HttpClient client,
String path)
Creates a new instance
|
static WebsocketClientTransport |
create(InetSocketAddress address)
Creates a new instance
|
static WebsocketClientTransport |
create(int port)
Creates a new instance connecting to localhost
|
static WebsocketClientTransport |
create(String bindAddress,
int port)
Creates a new instance
|
static WebsocketClientTransport |
create(reactor.netty.tcp.TcpClient client)
Creates a new instance
|
static WebsocketClientTransport |
create(URI uri)
Creates a new instance
|
WebsocketClientTransport |
header(String name,
String... values)
Add a header and value(s) to use for the WebSocket handshake request.
|
int |
maxFrameLength() |
WebsocketClientTransport |
webSocketSpec(Consumer<reactor.netty.http.client.WebsocketClientSpec.Builder> configurer)
Provide a consumer to customize properties of the
WebsocketClientSpec to use for
WebSocket upgrades. |
public static WebsocketClientTransport create(int port)
port - the port to connect topublic static WebsocketClientTransport create(String bindAddress, int port)
bindAddress - the address to connect toport - the port to connect toNullPointerException - if bindAddress is nullpublic static WebsocketClientTransport create(InetSocketAddress address)
address - the address to connect toNullPointerException - if address is nullpublic static WebsocketClientTransport create(reactor.netty.tcp.TcpClient client)
client - the TcpClient to useNullPointerException - if client or path is nullpublic static WebsocketClientTransport create(URI uri)
uri - the URI to connect toNullPointerException - if uri is nullpublic static WebsocketClientTransport create(reactor.netty.http.client.HttpClient client, String path)
client - the HttpClient to usepath - the path to requestNullPointerException - if client or path is nullpublic WebsocketClientTransport header(String name, String... values)
name - the header namevalues - the header value(s)public WebsocketClientTransport webSocketSpec(Consumer<reactor.netty.http.client.WebsocketClientSpec.Builder> configurer)
WebsocketClientSpec to use for
WebSocket upgrades. The consumer is invoked immediately.configurer - the configurer to apply to the specpublic int maxFrameLength()
maxFrameLength in interface io.rsocket.transport.Transportpublic Mono<io.rsocket.DuplexConnection> connect()
connect in interface io.rsocket.transport.ClientTransport