java.lang.Object
robaho.net.httpserver.extras.ProxyHandler
- All Implemented Interfaces:
HttpHandler
proxy requests to another host
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanauthorizeConnect(HttpExchange exchange) override to check authorization headers.protected voidconnectFailed(URI uri, SocketAddress sa, IOException ieo) voidhandle(HttpExchange exchange) protected Optional<ProxyHandler.HostPort> proxyTo(HttpExchange exchange)
-
Field Details
-
logger
-
-
Constructor Details
-
ProxyHandler
public ProxyHandler() -
ProxyHandler
-
-
Method Details
-
handle
- Specified by:
handlein interfaceHttpHandler- Throws:
IOException
-
authorizeConnect
override to check authorization headers. if returning false, the implementation must call exchange.sendResponseHeaders() with the appropriate code.- Returns:
- true if the CONNECT should proceed, else false
-
proxyTo
-
connectFailed
-