github.com/weaveworks/common@v0.0.0-20230728070032-dd9e68f319d5/tools/socks/README.md (about)

     1  # SOCKS Proxy
     2  
     3  The challenge: you’ve built and deployed your microservices based
     4  application on a Weave network, running on a set of VMs on EC2.  Many
     5  of the services’ public API are reachable from the internet via an
     6  Nginx-based reverse proxy, but some of the services also expose
     7  private monitoring and manage endpoints via embedded HTTP servers.
     8  How do I securely get access to these from my laptop, without exposing
     9  them to the world?
    10  
    11  One method we’ve started using at Weaveworks is a 90’s technology - a
    12  SOCKS proxy combined with a PAC script.  It’s relatively
    13  straight-forward: one ssh’s into any of the VMs participating in the
    14  Weave network, starts the SOCKS proxy in a container on Weave the
    15  network, and SSH port forwards a few local port to the proxy.  All
    16  that’s left is for the user to configure his browser to use the proxy,
    17  and voila, you can now access your Docker containers, via the Weave
    18  network (and with all the magic of weavedns), from your laptop’s
    19  browser!
    20  
    21  It is perhaps worth noting there is nothing Weave-specific about this
    22  approach - this should work with any SDN or private network.
    23  
    24  A quick example:
    25  
    26  ```
    27  vm1$ weave launch
    28  vm1$ eval $(weave env)
    29  vm1$ docker run -d --name nginx nginx
    30  ```
    31  
    32  And on your laptop
    33  
    34  ```
    35  laptop$ git clone https://github.com/weaveworks/tools
    36  laptop$ cd tools/socks
    37  laptop$ ./connect.sh vm1
    38  Starting proxy container...
    39  Please configure your browser for proxy
    40  http://localhost:8080/proxy.pac
    41  ```
    42  
    43  To configure your Mac to use the proxy:
    44  
    45  1. Open System Preferences
    46  2. Select Network
    47  3. Click the 'Advanced' button
    48  4. Select the Proxies tab
    49  5. Click the 'Automatic Proxy Configuration' check box
    50  6. Enter 'http://localhost:8080/proxy.pac' in the URL box
    51  7. Remove `*.local` from the 'Bypass proxy settings for these Hosts & Domains'
    52  
    53  Now point your browser at http://nginx.weave.local/