
io.muserver.MuWebSocketFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mu-server Show documentation
Show all versions of mu-server Show documentation
A simple but powerful web server framework
The newest version!
package io.muserver;
/**
* A factory that can convert an upgrade request into a web socket.
* This is registed with the {@link WebSocketHandlerBuilder#withWebSocketFactory(MuWebSocketFactory)} method.
*/
public interface MuWebSocketFactory {
/**
* Creates a web socket for an upgrade request.
* @param request An upgrade request.
* @param responseHeaders Any headers added to this object will be returned with the upgrade response.
* @return A web socket, or null if no websocket should be created (in which case the next handler in the chain
* will be called).
* @throws Exception Any thrown exceptions will result in errors being returned to the client. Note that
* exceptions such as {@link jakarta.ws.rs.ClientErrorException} can be used in order to
* control the HTTP response codes.
*/
MuWebSocket create(MuRequest request, Headers responseHeaders) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy