public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTransport
UndertowClient
.
Compatible with Undertow 1.0, 1.1, 1.2.
When used for testing purposes (e.g. load testing) or for specific use cases (like HTTPS configuration), a custom OptionMap should be provided:
OptionMap optionMap = OptionMap.builder() .set(Options.WORKER_IO_THREADS, 8) .set(Options.TCP_NODELAY, true) .set(Options.KEEP_ALIVE, true) .set(Options.WORKER_NAME, "SockJSClient") .getMap(); UndertowXhrTransport transport = new UndertowXhrTransport(optionMap);
Options
logger, PRELUDE
Constructor and Description |
---|
UndertowXhrTransport() |
UndertowXhrTransport(OptionMap optionMap) |
Modifier and Type | Method and Description |
---|---|
protected void |
connectInternal(TransportRequest request,
WebSocketHandler handler,
URI receiveUrl,
HttpHeaders handshakeHeaders,
XhrClientSockJsSession session,
SettableListenableFuture<WebSocketSession> connectFuture) |
protected ResponseEntity<String> |
executeInfoRequestInternal(URI infoUrl,
HttpHeaders headers) |
protected ResponseEntity<String> |
executeRequest(URI url,
io.undertow.util.HttpString method,
HttpHeaders headers,
String body) |
protected ResponseEntity<String> |
executeSendRequestInternal(URI url,
HttpHeaders headers,
TextMessage message) |
io.undertow.client.UndertowClient |
getHttpClient()
Return Undertow's native HTTP client
|
XnioWorker |
getWorker()
Return the
XnioWorker backing the I/O operations
for Undertow's HTTP client. |
connect, executeInfoRequest, executeSendRequest, getRequestHeaders, getTransportTypes, isXhrStreamingDisabled, setRequestHeaders, setXhrStreamingDisabled, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
executeSendRequest, isXhrStreamingDisabled
connect, getTransportTypes
executeInfoRequest
public UndertowXhrTransport() throws IOException
IOException
public UndertowXhrTransport(OptionMap optionMap) throws IOException
IOException
public io.undertow.client.UndertowClient getHttpClient()
public XnioWorker getWorker()
XnioWorker
backing the I/O operations
for Undertow's HTTP client.Xnio
protected void connectInternal(TransportRequest request, WebSocketHandler handler, URI receiveUrl, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture)
connectInternal
in class AbstractXhrTransport
protected ResponseEntity<String> executeInfoRequestInternal(URI infoUrl, HttpHeaders headers)
executeInfoRequestInternal
in class AbstractXhrTransport
protected ResponseEntity<String> executeSendRequestInternal(URI url, HttpHeaders headers, TextMessage message)
executeSendRequestInternal
in class AbstractXhrTransport
protected ResponseEntity<String> executeRequest(URI url, io.undertow.util.HttpString method, HttpHeaders headers, String body)