public class UndertowXhrTransport extends AbstractXhrTransport
UndertowClient
.
Requires Undertow 1.3 or 1.4, including XNIO, as of Spring Framework 5.0.
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, getTransportTypes, isXhrStreamingDisabled, setXhrStreamingDisabled
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, @Nullable String body)