Class ProxyServer
java.lang.Object
io.fluxzero.proxy.ProxyServer
- All Implemented Interfaces:
Registration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault connector idle timeout: 60 secondsstatic final intDefault maximum request and response header size: 1 MiBstatic final intDefault maximum in-flight web requests accepted by the proxy.static final longDefault maximum multipart request body size: 1 GiBstatic final intDefault maximum queued outgoing websocket sends per session.static final longDefault maximum request body size: 256 MiBstatic final intDefault Jetty maximum platform thread count.static final intDefault Jetty minimum platform thread count. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProxyServer(ProxyRequestHandler proxyHandler, org.eclipse.jetty.server.Server server, int port, Registration shutdownRegistration, boolean gracefulShutdown) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the resource or subscription associated with this registration.static voidStandalone process entry point.static ProxyServerstart()Starts an embedded proxy server using the configured port and runtime base URL.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Registration
merge
-
Field Details
-
DEFAULT_MAX_REQUEST_BODY_SIZE
public static final long DEFAULT_MAX_REQUEST_BODY_SIZEDefault maximum request body size: 256 MiB- See Also:
-
DEFAULT_MAX_MULTIPART_REQUEST_BODY_SIZE
public static final long DEFAULT_MAX_MULTIPART_REQUEST_BODY_SIZEDefault maximum multipart request body size: 1 GiB- See Also:
-
DEFAULT_MAX_HEADER_SIZE
public static final int DEFAULT_MAX_HEADER_SIZEDefault maximum request and response header size: 1 MiB- See Also:
-
DEFAULT_IDLE_TIMEOUT_MILLIS
public static final long DEFAULT_IDLE_TIMEOUT_MILLISDefault connector idle timeout: 60 seconds- See Also:
-
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADSDefault Jetty maximum platform thread count.- See Also:
-
DEFAULT_MIN_THREADS
public static final int DEFAULT_MIN_THREADSDefault Jetty minimum platform thread count.- See Also:
-
DEFAULT_MAX_IN_FLIGHT_WEB_REQUESTS
public static final int DEFAULT_MAX_IN_FLIGHT_WEB_REQUESTSDefault maximum in-flight web requests accepted by the proxy. A value of0disables this guardrail.- See Also:
-
DEFAULT_MAX_PENDING_WEBSOCKET_SENDS
public static final int DEFAULT_MAX_PENDING_WEBSOCKET_SENDSDefault maximum queued outgoing websocket sends per session.- See Also:
-
-
Constructor Details
-
ProxyServer
protected ProxyServer(ProxyRequestHandler proxyHandler, org.eclipse.jetty.server.Server server, int port, Registration shutdownRegistration, boolean gracefulShutdown)
-
-
Method Details
-
main
-
start
Starts an embedded proxy server using the configured port and runtime base URL.The port is resolved from
FLUXZERO_PROXY_PORT,PROXY_PORT, or8080, in that order. The Fluxzero runtime URL is resolved fromFLUXZERO_BASE_URL,FLUX_BASE_URL, orFLUX_URL, in that order. The returned server owns the created Fluxzero client and forward proxy consumer; callers should stop all embedded proxy resources by callingcancel().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
-
cancel
public void cancel()Description copied from interface:RegistrationCancels the resource or subscription associated with this registration.Calling this method should be idempotent and safe to invoke multiple times.
- Specified by:
cancelin interfaceRegistration
-