K
Knorpi
Hi,
I would like to setup a server "myserver" that acts as a proxy for its clients. The clients pass the url of the web page they want in a query string:
- client sends a HTTP request:
http://myserver?url=www.foreignurl.com&par2=val1
- Servlet on myserver extracts url from query string:
www.foreignurl.com
- Servlet sends HTTP request to other server with query string:
http://www.foreignurl.com?par1=val1
- Servlet renders complete response from other server
into a String "content"
- Servlet changes every link in the content to point to myserver
so that all links are accessed the same way
- Servlet sends response to client
The most important part would be to change all links in the response.
Can you give me some hints how to do this?
Thanks
Magnus
I would like to setup a server "myserver" that acts as a proxy for its clients. The clients pass the url of the web page they want in a query string:
- client sends a HTTP request:
http://myserver?url=www.foreignurl.com&par2=val1
- Servlet on myserver extracts url from query string:
www.foreignurl.com
- Servlet sends HTTP request to other server with query string:
http://www.foreignurl.com?par1=val1
- Servlet renders complete response from other server
into a String "content"
- Servlet changes every link in the content to point to myserver
so that all links are accessed the same way
- Servlet sends response to client
The most important part would be to change all links in the response.
Can you give me some hints how to do this?
Thanks
Magnus