Interface WebSocketFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Security filter to decide if an incoming web socket connection is acceptable.
Sample:
apiGateway.setWebSocketFilter(req -> {
return req.getPath().equals("chat");
});
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidInvokes when a WebSocket Endpoint closes.io.datatree.PromiseonConnect(WebRequest request) Decides whether to accept the incoming WebSocket request or close the connection.
-
Method Details
-
onConnect
Decides whether to accept the incoming WebSocket request or close the connection.- Parameters:
request- incoming WebSocket connection- Returns:
- true = accept connection, false = close socket
-
onClose
-