|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.jetty.http.handler.AbstractHttpHandler
org.openqa.selenium.server.ProxyHandler
public class ProxyHandler
Proxy request handler. A HTTP/1.1 Proxy. This implementation uses the JVMs URL implementation to make proxy requests.
The HttpTunnel mechanism is also used to implement the CONNECT method.
Nested Class Summary | |
---|---|
static class |
ProxyHandler.SslRelay
|
Field Summary | |
---|---|
protected HashSet<Integer> |
_allowedConnectPorts
Set of allowed CONNECT ports. |
protected StringMap |
_DontProxyHeaders
Map of leg by leg headers (not end to end). |
protected StringMap |
_ProxyAuthHeaders
Map of leg by leg headers (not end to end). |
protected Set<String> |
_proxyHostsBlackList
|
protected Set<String> |
_proxyHostsWhiteList
|
protected StringMap |
_ProxySchemes
Map of allows schemes to proxy Should be a set, but more efficient string map is used instead. |
protected int |
_tunnelTimeoutMs
|
Constructor Summary | |
---|---|
ProxyHandler(boolean trustAllSSLCertificates,
String dontInjectRegex,
String debugURL,
boolean proxyInjectionMode,
boolean forceProxyChain,
int port,
Object shutdownLock)
|
Method Summary | |
---|---|
void |
generateSSLCertsForLoggingHosts(HttpServer server)
|
protected ProxyHandler.SslRelay |
getSslRelayOrCreateNew(URI uri,
String serverHost,
Integer serverPort,
HttpServer server)
|
void |
handle(String pathInContext,
String pathParams,
HttpRequest request,
HttpResponse response)
Handle a request. |
void |
handleConnect(HttpRequest request,
HttpResponse response)
|
protected boolean |
isForbidden(String scheme,
String host)
Is scheme,host & port Forbidden. |
protected boolean |
isForbidden(URI uri)
Is URL Forbidden. |
protected URL |
isProxied(URI uri)
Is URL Proxied. |
protected HttpTunnel |
newHttpTunnel(HttpResponse response,
InetAddress iaddr,
int port,
int timeoutMS)
|
protected long |
proxyPlainTextRequest(URL url,
HttpRequest request,
HttpResponse response)
|
protected void |
sendForbid(HttpResponse response)
Send Forbidden. |
protected void |
sendNotFound(HttpResponse response)
Send not found. |
boolean |
shouldInject(String path)
|
void |
start()
Start the LifeCycle. |
protected void |
wireUpSslWithCyberVilliansCA(String host,
ProxyHandler.SslRelay listener)
|
Methods inherited from class org.openqa.jetty.http.handler.AbstractHttpHandler |
---|
getHttpContext, getName, handleTrace, initialize, isStarted, setName, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Set<String> _proxyHostsWhiteList
protected Set<String> _proxyHostsBlackList
protected int _tunnelTimeoutMs
protected StringMap _DontProxyHeaders
protected StringMap _ProxyAuthHeaders
protected StringMap _ProxySchemes
protected HashSet<Integer> _allowedConnectPorts
Constructor Detail |
---|
public ProxyHandler(boolean trustAllSSLCertificates, String dontInjectRegex, String debugURL, boolean proxyInjectionMode, boolean forceProxyChain, int port, Object shutdownLock)
Method Detail |
---|
public void start() throws Exception
LifeCycle
start
in interface LifeCycle
start
in class AbstractHttpHandler
Exception
- An arbitrary exception may be thrown.public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws IOException
HttpHandler
pathInContext
- The context pathpathParams
- Path parameters such as encoded Session IDrequest
- The HttpRequest requestresponse
- The HttpResponse response
IOException
protected long proxyPlainTextRequest(URL url, HttpRequest request, HttpResponse response) throws IOException
IOException
public boolean shouldInject(String path)
public void generateSSLCertsForLoggingHosts(HttpServer server)
public void handleConnect(HttpRequest request, HttpResponse response) throws IOException
IOException
protected ProxyHandler.SslRelay getSslRelayOrCreateNew(URI uri, String serverHost, Integer serverPort, HttpServer server) throws Exception
Exception
protected void wireUpSslWithCyberVilliansCA(String host, ProxyHandler.SslRelay listener)
protected HttpTunnel newHttpTunnel(HttpResponse response, InetAddress iaddr, int port, int timeoutMS) throws IOException
IOException
protected URL isProxied(URI uri) throws MalformedURLException
uri
- The requested URI, which should include a scheme, host and port.
MalformedURLException
protected boolean isForbidden(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 lists
protected void sendForbid(HttpResponse response) throws IOException
IOException
protected void sendNotFound(HttpResponse response) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |