Package io.muserver

Interface MuWebSocketFactory

    • Method Detail

      • create

        MuWebSocket create​(MuRequest request,
                           Headers responseHeaders)
                    throws java.lang.Exception
        Creates a web socket for an upgrade request.
        Parameters:
        request - An upgrade request.
        responseHeaders - Any headers added to this object will be returned with the upgrade response.
        Returns:
        A web socket, or null if no websocket should be created (in which case the next handler in the chain will be called).
        Throws:
        java.lang.Exception - Any thrown exceptions will result in errors being returned to the client. Note that exceptions such as ClientErrorException can be used in order to control the HTTP response codes.