I have developed a reverse proxy and currently ONLY process the "html/text" responses from the remote applications, everything else (images, javascript, etc) are passed thru unmodified. The problem I'm having is when the remote site contains javascript that dynamically inserts either java applets or activex controls into the page, as this occurs AFTER I've processed the response and changed all of the URI's.
So for example:
You navigate to the reverse proxy to access remotesite18:
http://reverseproxy.tld/remotesite18
the reverse proxy then makes a call to remotesite18:
http://remotesite18.mysites.tld/
the response has links in the HTML which are modified: from
<a href="/images/banner.jpg" />
to
<a href="http://reverseproxy.tld/remotesite18/images/banner.jpg" />
etc.
BUT what happens when javascript dynamically inserts an applet tag with a relative path of:
test.jar
the request might come back as
http://reverseproxy.tld/test.jar
resulting in a 404. i need to route it to:
http://reversproxy.tld/remotesite18/test.jar
So I need to insert my own JavaScript that can reroute these requests. I know that Glype does this to a certain extent, but I haven't been able to pinpoint how.
Any help is greatly appreciated.