|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.isomorphic.servlet.BaseServlet | +--com.isomorphic.servlet.HttpProxyServlet
The HttpProxyServlet proxies http requests for the client (browser) - typically for web service calls where cross-domain restictions prevent the browser from making a direct call to a particular URL. SmartClient automatically determines when a request is cross-domain and uses this servlet to make the request.
You can use a set of regular expressions to restrict the list of URLs that this servlet will
proxy to. You can specify these win web.xml using the rules
init-param or in a
separate file. See the rules
and rulesFile
javadoc below. If no
rules are specified, this filter will proxy to any URL requested by the client. If at least
one rule is specified, then any URLs not matching the set of rules is disallowed.
Field Summary | |
boolean |
acceptInvalidAndExpiredSSLCertificates
If set to true, the proxy will accept invalid and expired SSL certificates from the proxied URL. |
java.lang.String |
proxyHost
If outbound HTTP requests from this proxy must go through a proxy, you can set the hostname of the proxy server via this parameter. |
int |
proxyPort
If outbound HTTP requests from this proxy must go through a proxy, you can set the port of the proxy server via this parameter. |
protected java.util.List |
rules
You can specify the set of URLs proxyable by this servlet inline in web.xml. |
java.lang.String |
rulesFile
Specifies path to a file that contains a set of regexp rules that constrain what URLs this servlet will proxy to. |
int |
urlCacheSize
Specifies the size of the URLCache. |
boolean |
useURLCache
This parameter controls whether the URLCache is enabled or not. |
Field Detail |
public java.lang.String proxyHost
If the JVM executing this servlet can make direct HTTP connections to the relevant hosts, leave this parameter unset.
public java.lang.String rulesFile
var rules = [ "match:#http://www.slashdot.org/#", ];Note: The rulesFile path is treated as relative to webRoot.
public boolean useURLCache
rulesFile
, the URL Cache will
cache the result of the application of relevant rules for any given URL. The URL Cache
drastically speeds up subsequent rule applications at the cost of memory.
Note: the cache is automatically disabled if there are no rules to apply.
Performance: The URL cache is an LRU Map. If you're using this servlet on a large-scale site
with a lot of unique URLs, you may want to tune its size via the
urlCacheSize
parameter to balance between memory
usage and performance.
urlCacheSize
public int urlCacheSize
protected java.util.List rules
rules
init-param of this servlet. For example:
<servlet> <servlet-name>HttpProxyServlet</filter-name> <filter-class>com.isomorphic.servlet.HttpProxyServlet</filter-class> <init-param> <param-name>rules</param-name> <param-value> match:|http://www.slashdot.org/| </param-value> </init-param> </filter>
rulesFile
public boolean acceptInvalidAndExpiredSSLCertificates
public int proxyPort
If the JVM executing this servlet can make direct HTTP connections to the relevant hosts, leave this parameter unset.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |