Search code examples
javascriptproxyreverse-proxy

Proxy web traffic through javascript running in a separate browser


I want to have a browser running on one machine proxy its traffic through a different browser on another machine.

Here's how I believe it might work:

  user
   |
+--------------+
| user browser |
+--------------+
   |
   \/
+--------------+
| proxy server |
+--------------+
   | websocket traffic
   \/
+----------------+   
| second browser |  special "proxy page" javascript   
+----------------+   
   |
   \/
+------------+
| web server | web site A
+------------+

In more detail:

  1. The user's browser is set up as usual to use the proxy server, so all outgoing web traffic goes through the proxy sever.

  2. The proxy server then sends all of that traffic, via websockets, to the second browser, which is already open at a special page.

  3. The javascript on the special page then forwards the incoming traffic directly to web site A. To all intent and purposes, it looks to the web site like the user is using the second browser.

I'd like some technology suggestions for both the proxy server and also the matching javascript inside the special page running on the second browser, and any gotchas that might arise.


Solution

  • This is not possible due to same-origin policy restrictions applied by the second browser. You'll need a different application running on that computer.