Class ProxyServer

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

public class ProxyServer extends Object implements Registration
  • Constructor Details

    • ProxyServer

      public ProxyServer()
  • Method Details

    • main

      public static void main(String[] args)
    • start

      public static ProxyServer start(ProxyRequestHandler proxyHandler)
      Starts a proxy server on a random available port with the specified proxy request handler. The server will listen for HTTP requests and route them through the provided handler.
      Parameters:
      proxyHandler - the handler responsible for processing proxy requests.
      Returns:
      a ProxyServer instance representing the started proxy server, allowing further management such as shutdown.
    • start

      public static ProxyServer start(int port, ProxyRequestHandler proxyHandler)
      Starts a proxy server on the specified port with the given proxy request handler. The server will listen for HTTP requests and route them through the provided handler. Additionally, it sets up a health endpoint that responds with a simple "Healthy" message.
      Parameters:
      port - the port number on which the proxy server will listen. Use 0 to select a random available port.
      proxyHandler - the handler responsible for processing proxy requests.
      Returns:
      a ProxyServer instance representing the started proxy server, allowing further management such as shutdown.
    • 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