Package io.muserver
Class WebSocketHandler
- java.lang.Object
-
- io.muserver.WebSocketHandler
-
- All Implemented Interfaces:
MuHandler
public class WebSocketHandler extends java.lang.Object implements MuHandler
A handler that can establish a web socket based on web socket upgrade requests. Create withWebSocketHandlerBuilder.webSocketHandler()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandle(MuRequest request, MuResponse response)Called when an HTTP request is made (unless a previous handler stopped handler processing)java.lang.StringtoString()
-
-
-
Method Detail
-
handle
public boolean handle(MuRequest request, MuResponse response) throws java.lang.Exception
Description copied from interface:MuHandlerCalled when an HTTP request is made (unless a previous handler stopped handler processing)- Specified by:
handlein interfaceMuHandler- Parameters:
request- The HTTP request.response- The HTTP response.- Returns:
- Return
falseto continue processing the next handler (for example if writing a filter or inspector); ortrueto stop processing (normally done if this handler sent a response). - Throws:
java.lang.Exception- Any uncaught exceptions will result in a 500 error code being returned to the client with a simple message.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-