Last active
August 29, 2015 14:10
-
-
Save marcojahn/391b30ffd359a1abf623 to your computer and use it in GitHub Desktop.
sencha cmd "patch"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// com.sencha.util.http.Server.class | |
// new, more glue code skipped | |
private createProxyConfigObject(String path, String host, int port) { | |
return new ProxyConfigObject(path, host, port); | |
} | |
// existing, to be modified | |
private Server(Responder responder, int port) { | |
this(port); | |
if(responder instanceof Member) { | |
((Member)responder).join(this._stopper); | |
} | |
/* modifcation | |
- missing parameters (proxyPath, proxyHost, proxyPort) must be configurable | |
- must be able to use multiple remote configurations (loop needed) */ | |
ProxyConfigObject pco = this.createProxyConfigObject(proxyPath, proxyHost, proxyPort); | |
this.mount(pco, (Responder)responder); | |
// original | |
this.mount("/", (Responder)responder); | |
} | |
// new mount for remote ProxyConfigObject | |
public void mount (ProxyConfigObject pco) { | |
// http://download.eclipse.org/jetty/stable-8/apidocs/org/eclipse/jetty/servlets/ProxyServlet.Transparent.html#proxyHttpURI(java.lang.String,%20java.lang.String,%20int,%20java.lang.String) | |
// use ProxyServlet.Transparent | |
// ... | |
// more glue code within here | |
context.addServlet(new ProxyServlet.Transparent(pco.getPath(), pco.getHost, pco.getPort() ), "/" + pco.getPath()); | |
// ... | |
} | |
// com.sencha.util.http.DispatchServlet.class | |
/* | |
remote proxy urls must be excluded from being dispatched, stackoverflow example | |
http://stackoverflow.com/questions/3125296/can-i-exclude-some-concrete-urls-from-url-pattern-inside-filter-mapping | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment