Class ProxyWebsocketEndpoint

java.lang.Object
io.fluxzero.proxy.ProxyWebsocketEndpoint

public class ProxyWebsocketEndpoint extends Object
  • Constructor Details

    • ProxyWebsocketEndpoint

      public ProxyWebsocketEndpoint(Client client, RequestHandler requestHandler)
  • Method Details

    • onOpen

      public void onOpen(io.fluxzero.proxy.ProxyWebsocketSession session)
      Registers an opened socket, forwards its open notification, and schedules keep-alive checks.
    • onBinary

      public void onBinary(io.fluxzero.proxy.ProxyWebsocketSession session, byte[] message)
      Forwards a binary frame as a socket message request.
    • onText

      public void onText(io.fluxzero.proxy.ProxyWebsocketSession session, String message)
      Encodes a text frame as UTF-8 and forwards it as a socket message request.
    • onPong

      public void onPong(io.fluxzero.proxy.ProxyWebsocketSession session, ByteBuffer message)
      Consumes matching internal keep-alive pongs and forwards other pong payloads to application handlers.
    • onClose

      public void onClose(io.fluxzero.proxy.ProxyWebsocketSession session, WebsocketCloseReason closeReason)
      Removes session bookkeeping and keep-alive scheduling, sends its close notification, and waits up to the configured notification timeout. Notification failures propagate and are recorded for close completion.
    • onError

      public void onError(io.fluxzero.proxy.ProxyWebsocketSession session, Throwable error)
      Logs a socket transport error, distinguishing already closing channels and idle timeouts from unexpected failures.
    • sendRequest

      protected CompletableFuture<?> sendRequest(io.fluxzero.proxy.ProxyWebsocketSession session, String method, byte[] payload)
    • sendCloseRequest

      protected CompletableFuture<?> sendCloseRequest(io.fluxzero.proxy.ProxyWebsocketSession session, WebsocketCloseReason closeReason)
    • handleResultMessages

      protected void handleResultMessages(List<SerializedMessage> resultMessages)
    • handleDisconnects

      protected void handleDisconnects(List<SerializedMessage> resultMessages)
    • getContext

      protected ProxyWebsocketEndpoint.SessionContext getContext(io.fluxzero.proxy.ProxyWebsocketSession session)
    • ensureStarted

      protected void ensureStarted()
    • shutDown

      public void shutDown()
      Shuts down the endpoint with the default close-notification timeout and the standard client and request-handler cleanup policy.