Page: [root]/howto/use-sockets-via-http-proxy | src | faq | css

How to use HTTP proxy to access normal Internet

Prerequisites

  1. Shell account with normal internet access and listening to port 443 (if only 80 and 443 ports are permitted)
  2. ssh on localhost
  3. corkscrew
  4. GNU compiler toolchain on localhost to build corkscrew and tsocks.
  5. HTTP proxy access
  6. tsocks (optional)

So.

1. Download corkscrew and compile it (./configure && make)

2. If you don't have .ssh/config, create it and set up permissions (chmod a-rw,g-rw,u+rw)

3. Add following code to .ssh/config:

ProxyCommand /home/user/corkscrew-2.0/corkscrew proxy.example.com 8080 %h %p

where proxy.example.com and 8080 are your proxy's host and port, and /home/user/corkscrew-2.0/corkscrew is path to corkscrew executable. If proxy needs authentication, create a file with username and password separated by ":" and use its path as last argument to corkscrew.

4. Run:

% ssh -D 8081 -p 443 myhost

where 8081 is local port on which SOCKS-proxy to normal internet will be listening, 443 is remote ssh port and myhost is your SSH server.

5. Use localhost:8081 as SOCKS-proxy to access the internet. If program does not support it, you can use tsocks to wrap it.


Powered by bitcheese wiki engine