public class ProxyHandler
extends org.openqa.jetty.http.handler.AbstractHttpHandler
Modifier and Type | Class and Description |
---|---|
static class |
ProxyHandler.SslRelay |
Modifier and Type | Field and Description |
---|---|
protected HashSet<Integer> |
_allowedConnectPorts
Set of allowed CONNECT ports.
|
protected org.openqa.jetty.util.StringMap |
_DontProxyHeaders
Map of leg by leg headers (not end to end).
|
protected org.openqa.jetty.util.StringMap |
_ProxyAuthHeaders
Map of leg by leg headers (not end to end).
|
protected Set<String> |
_proxyHostsBlackList |
protected Set<String> |
_proxyHostsWhiteList |
protected org.openqa.jetty.util.StringMap |
_ProxySchemes
Map of allows schemes to proxy Should be a set, but more efficient string map is used instead.
|
protected int |
_tunnelTimeoutMs |
Constructor and Description |
---|
ProxyHandler(boolean trustAllSSLCertificates,
String dontInjectRegex,
String debugURL,
boolean proxyInjectionMode,
boolean forceProxyChain,
int port,
Object shutdownLock) |
Modifier and Type | Method and Description |
---|---|
void |
generateSSLCertsForLoggingHosts(org.openqa.jetty.http.HttpServer server) |
protected ProxyHandler.SslRelay |
getSslRelayOrCreateNew(org.openqa.jetty.util.URI uri,
String serverHost,
Integer serverPort,
org.openqa.jetty.http.HttpServer server) |
void |
handle(String pathInContext,
String pathParams,
org.openqa.jetty.http.HttpRequest request,
org.openqa.jetty.http.HttpResponse response) |
void |
handleConnect(org.openqa.jetty.http.HttpRequest request,
org.openqa.jetty.http.HttpResponse response) |
protected boolean |
isForbidden(String scheme,
String host)
Is scheme,host & port Forbidden.
|
protected boolean |
isForbidden(org.openqa.jetty.util.URI uri)
Is URL Forbidden.
|
protected URL |
isProxied(org.openqa.jetty.util.URI uri)
Is URL Proxied.
|
protected org.openqa.jetty.http.HttpTunnel |
newHttpTunnel(org.openqa.jetty.http.HttpResponse response,
InetAddress iaddr,
int port,
int timeoutMS) |
protected long |
proxyPlainTextRequest(URL url,
org.openqa.jetty.http.HttpRequest request,
org.openqa.jetty.http.HttpResponse response) |
protected void |
sendForbid(org.openqa.jetty.http.HttpResponse response)
Send Forbidden.
|
protected void |
sendNotFound(org.openqa.jetty.http.HttpResponse response)
Send not found.
|
boolean |
shouldInject(String path) |
void |
start() |
protected void |
wireUpSslWithCyberVilliansCA(String host,
ProxyHandler.SslRelay listener) |
protected int _tunnelTimeoutMs
protected org.openqa.jetty.util.StringMap _DontProxyHeaders
protected org.openqa.jetty.util.StringMap _ProxyAuthHeaders
protected org.openqa.jetty.util.StringMap _ProxySchemes
public void start() throws Exception
start
in interface org.openqa.jetty.util.LifeCycle
start
in class org.openqa.jetty.http.handler.AbstractHttpHandler
Exception
public void handle(String pathInContext, String pathParams, org.openqa.jetty.http.HttpRequest request, org.openqa.jetty.http.HttpResponse response) throws IOException
IOException
protected long proxyPlainTextRequest(URL url, org.openqa.jetty.http.HttpRequest request, org.openqa.jetty.http.HttpResponse response) throws IOException
IOException
public boolean shouldInject(String path)
public void generateSSLCertsForLoggingHosts(org.openqa.jetty.http.HttpServer server)
public void handleConnect(org.openqa.jetty.http.HttpRequest request, org.openqa.jetty.http.HttpResponse response) throws IOException
IOException
protected ProxyHandler.SslRelay getSslRelayOrCreateNew(org.openqa.jetty.util.URI uri, String serverHost, Integer serverPort, org.openqa.jetty.http.HttpServer server) throws Exception
Exception
protected void wireUpSslWithCyberVilliansCA(String host, ProxyHandler.SslRelay listener)
protected org.openqa.jetty.http.HttpTunnel newHttpTunnel(org.openqa.jetty.http.HttpResponse response, InetAddress iaddr, int port, int timeoutMS) throws IOException
IOException
protected URL isProxied(org.openqa.jetty.util.URI uri) throws MalformedURLException
uri
- The requested URI, which should include a scheme, host and port.MalformedURLException
protected boolean isForbidden(org.openqa.jetty.util.URI uri)
protected boolean isForbidden(String scheme, String host)
scheme
- A scheme that mast be in the proxySchemes StringMap.host
- A host that must pass the white and black listsprotected void sendForbid(org.openqa.jetty.http.HttpResponse response) throws IOException
IOException
protected void sendNotFound(org.openqa.jetty.http.HttpResponse response) throws IOException
IOException
Copyright © 2014. All rights reserved.