Class ProxyServer

java.lang.Object
io.fluxzero.proxy.ProxyServer
All Implemented Interfaces:
Registration

public class ProxyServer extends Object implements Registration
  • Field Details

    • DEFAULT_MAX_REQUEST_BODY_SIZE

      public static final long DEFAULT_MAX_REQUEST_BODY_SIZE
      Default maximum request body size: 256 MiB
      See Also:
    • DEFAULT_MAX_MULTIPART_REQUEST_BODY_SIZE

      public static final long DEFAULT_MAX_MULTIPART_REQUEST_BODY_SIZE
      Default maximum multipart request body size: 1 GiB
      See Also:
    • DEFAULT_MAX_HEADER_SIZE

      public static final int DEFAULT_MAX_HEADER_SIZE
      Default maximum request and response header size: 1 MiB
      See Also:
    • DEFAULT_IDLE_TIMEOUT_MILLIS

      public static final long DEFAULT_IDLE_TIMEOUT_MILLIS
      Default connector idle timeout: 60 seconds
      See Also:
    • DEFAULT_MAX_THREADS

      public static final int DEFAULT_MAX_THREADS
      Default Jetty maximum platform thread count.
      See Also:
    • DEFAULT_MIN_THREADS

      public static final int DEFAULT_MIN_THREADS
      Default Jetty minimum platform thread count.
      See Also:
    • DEFAULT_MAX_IN_FLIGHT_WEB_REQUESTS

      public static final int DEFAULT_MAX_IN_FLIGHT_WEB_REQUESTS
      Default maximum in-flight web requests accepted by the proxy. A value of 0 disables this guardrail.
      See Also:
    • DEFAULT_MAX_PENDING_WEBSOCKET_SENDS

      public static final int DEFAULT_MAX_PENDING_WEBSOCKET_SENDS
      Default maximum queued outgoing websocket sends per session.
      See Also:
    • DEFAULT_WEBSOCKET_IDLE_TIMEOUT_MILLIS

      public static final long DEFAULT_WEBSOCKET_IDLE_TIMEOUT_MILLIS
      Default websocket idle timeout: 120 seconds
      See Also:
    • DEFAULT_WEBSOCKET_PING_DELAY_MILLIS

      public static final long DEFAULT_WEBSOCKET_PING_DELAY_MILLIS
      Default delay between proxy websocket keep-alive pings: 55 seconds
      See Also:
    • DEFAULT_WEBSOCKET_PING_TIMEOUT_MILLIS

      public static final long DEFAULT_WEBSOCKET_PING_TIMEOUT_MILLIS
      Default time allowed for receiving a proxy websocket keep-alive pong: 10 seconds
      See Also:
  • Constructor Details

  • Method Details

    • main

      public static void main(String[] args)
      Standalone process entry point.

      Do not call this method to embed the proxy in another application. Use start() instead so the caller owns the proxy lifecycle and shutdown order.

    • start

      public static ProxyServer start()
      Starts an embedded proxy server using the configured port and runtime base URL.

      The port is resolved from FLUXZERO_PROXY_PORT, PROXY_PORT, or 8080, in that order. The Fluxzero runtime URL is resolved from FLUXZERO_BASE_URL, FLUX_BASE_URL, or FLUX_URL, in that order. The returned server owns the created Fluxzero client and forward proxy consumer; callers should stop all embedded proxy resources by calling cancel().

      This method does not register a JVM shutdown hook, create a Fluxzero keepalive thread, or set a global Fluxzero application instance. Use main(String[]) for standalone process startup.

      Returns:
      a ProxyServer instance representing the started proxy server and owned embedded resources
    • start

      public static ProxyServer start(ProxyServerConfig config)
      Starts an embedded proxy server with explicit configuration.

      The returned server owns the created Fluxzero client and forward proxy consumer; callers should stop all embedded proxy resources by calling cancel().

      Parameters:
      config - proxy server configuration
      Returns:
      a ProxyServer instance representing the started proxy server and owned embedded resources
    • isReady

      public boolean isReady()
      Returns whether the proxy has reached runtime readiness and is not draining.
    • cancel

      public void cancel()
      Description copied from interface: Registration
      Cancels the resource or subscription associated with this registration.

      Calling this method should be idempotent and safe to invoke multiple times.

      Specified by:
      cancel in interface Registration