Class JettyWebsocketRouter

java.lang.Object
io.fluxzero.testserver.websocket.JettyWebsocketRouter

public class JettyWebsocketRouter extends Object
Embedded Jetty router for the test server's WebSocket endpoints and health check.
  • Constructor Details

    • JettyWebsocketRouter

      public JettyWebsocketRouter()
  • Method Details

    • addRoute

      public JettyWebsocketRouter addRoute(String path, Function<ServerWebsocketSession, WebsocketEndpoint> endpointSupplier)
      Registers a WebSocket route.
      Parameters:
      path - route path, with or without leading/trailing slash
      endpointSupplier - creates the Fluxzero endpoint for each accepted session
      Returns:
      this router
    • start

      public org.eclipse.jetty.server.Server start(int port) throws Exception
      Starts Jetty on the given port.
      Returns:
      the started Jetty server, owned by the caller
      Throws:
      Exception