Class ProxyServer
java.lang.Object
io.fluxzero.proxy.ProxyServer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()static voiddefault io.fluxzero.common.Registrationmerge(io.fluxzero.common.Registration arg0) static ProxyServerstart(int port, ProxyRequestHandler proxyHandler) Starts a proxy server on the specified port with the given proxy request handler.static ProxyServerstart(ProxyRequestHandler proxyHandler) Starts a proxy server on a random available port with the specified proxy request handler.
-
Constructor Details
-
ProxyServer
public ProxyServer()
-
-
Method Details
-
main
-
start
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
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() -
merge
default io.fluxzero.common.Registration merge(io.fluxzero.common.Registration arg0)
-