public class WebSocketProxyFilter extends Object implements Filter, Closeable
WebSocketProxyFilter
detects WebSocket upgrade requests and, when found, connects
to the protected application using a dedicated tunnel.
It then performs the HTTP handshake and, if successful, upgrades the HTTP connection, and finally starts to relay byte buffers between the connected client and the remote application (bidirectional).
Modifier and Type | Field and Description |
---|---|
static Option<Integer> |
NUMBER_OF_SELECTORS
Option allowing configuration of the number of selector threads.
|
Constructor and Description |
---|
WebSocketProxyFilter(Options options)
Constructs a new web-socket filter with the given set of
Options . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Promise<Response,NeverThrowsException> |
filter(Context context,
Request request,
Handler next)
Filters the request and/or response of an exchange.
|
public WebSocketProxyFilter(Options options) throws IOException
Options
.options
- WebSocket optionsIOException
- thrown if low level Grizzly transport cannot be instantiatedpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next)
Filter
next.handle(context, request)
.
This method may elect not to pass the request to the next filter or
handler, and instead handle the request itself. It can achieve this by
merely avoiding a call to next.handle(context, request)
and creating its own response object. The filter is also at liberty to
replace a response with another of its own by intercepting the response
returned by the next handler.
Copyright 2011-2017 ForgeRock AS.