SYNOPSIS

  desproxy remote_host remote_port proxy_host proxy_port local_port

OPTIONS

None.

DESCRIPTION

\s-1HTTP\s0 proxies are network servers that are used to give \s-1HTTP\s0 (web) access to computers that are not connected to the Internet. This is a typical scenario in corporate networks and recently in home networks too. \s-1HTTP\s0 proxies connect to the Internet either directly or via a parent proxy (which in fact connects to the Internet directly or via another parent proxy, and so on...)

\s-1HTTP\s0 clients (web browsers) use \s-1HTTP\s0 proxies to request web pages; the \s-1HTTP\s0 server just forwards those request to the destination server. All the negotiation is done via the \s-1HTTP\s0 protocol, which is designed just to carry \s-1HTTP\s0 requests and no generic (\s-1TCP/IP\s0) traffic. That is why you can't (normally) use Internet applications beside your web server if you are behind a \s-1HTTP\s0 proxy.

That is what desproxy is good for. Desproxy is a \s-1TCP\s0 tunnel, which means desproxy can forward \s-1TCP/IP\s0 traffic via a \s-1HTTP\s0 proxy. Desproxy uses a \s-1HTTP/1\s0.1 method (\s-1CONNECT\s0) to establish \s-1TCP/IP\s0 connections on demand. \s-1CONNECT\s0 is used for \s-1SSL\s0 connections when accessing to secure sites, so if you can access sites that support \s-1SSL\s0 (www.hotmail.com for example) you can use desproxy.

Not all \s-1IP\s0 (Internet) traffic is just \s-1TCP/IP\s0. In fact there are two more protocols widely used in the Internet not supported by desproxy: \s-1UDP\s0 and \s-1ICMP:\s0

  • \s-1ICMP\s0 is used to manage large \s-1IP\s0 networks. The only application using \s-1ICMP\s0 you may miss is ping.

  • \s-1UDP\s0 is an unreliable connection-less fast transport protocol, mostly used in network games and other applications that need low latency network traffic. Notably \s-1DNS\s0 uses \s-1UDP\s0 packets for fast delivery.

Will desproxy work with my \s-1HTTP\s0 proxy?

Short answer: just give it a try

Long answer: desproxy should work with every \s-1HTTP\s0 proxy, with the following exceptions:

  • \s-1MS\s0 Proxies with \s-1NTLM\s0 authentication. \s-1NTLM\s0 is a proprietary authentication method from Microsoft, not a standard authentication method. Maybe in the future desproxy will support \s-1NTLM\s0 authentication, but currently it doesn't.

  • \s-1HTTP/1\s0.0 Proxies. Desproxy needs the \s-1CONNECT\s0 method, which is only available from \s-1HTTP/1\s0.1 protocol version. It's very unlikely your proxy doesn't accept \s-1HTTP/1\s0.1 requests.

  • \s-1HTTP/1\s0.1 Proxies without the \s-1CONNECT\s0 method. Maybe your network administrator deactivated \s-1CONNECT\s0 support in the proxy, or maybe \s-1CONNECT\s0 is restricted to the \s-1HTTPS\s0 port (443).

Assumptions

Let's assume the following:

  • your \s-1HTTP\s0 proxy host name is \*(L"proxy\*(R" and its address is \*(L"192.0.0.1\*(R"

  • your \s-1HTTP\s0 proxy port is \*(L"8080\*(R"

  • your \s-1HTTP\s0 proxy doesn't need authentication. It case you need \s-1HTTP\s0 authentication, please read [2]this.

  • your system console will be a terminal (xterm, the console or a virtual terminal) if you are running Linux, *BSD or other UN*X

About connections

Imagine you need a network application that uses only one \s-1TCP/IP\s0 connection with just one server. That's the case of \s-1IRC\s0 in which you connect to an \s-1IRC\s0 server or ssh where you tipically connect just to one \s-1UNIX\s0 computer at a time. That's what I called a \*(L"static connection\*(R".

Of course that's not the case of a web browser or a file sharing program, both of them doing several connections at a time to different computers. That's what I call \*(L"dynamic connections\*(R".

STATIC CONNECTIONS EXAMPLES

item How to use desproxy to connect to \s-1IRC\s0

Suppose you want to connect to \s-1IRC\s0 using irc.undernet.org port 6667 as your \s-1IRC\s0 server. First you have to start a system console (see Assumptions above for details) and type

desproxy irc.undernet.org 6667 proxy 8080 1080

That should start desproxy, giving you the copyright notice along with some information. The following is a screen capture from desproxy 0.0.23

----------------------------------- desproxy 0.0.23

(c) Miguelanxo Otero Salgueiro 2001

This release brought to you patched by Rutger Nijlunsig.

See RutgerWork.txt in documentation for details about new features.

Great work guy! ----------------------------------- TCP port 1080 Binded & Listening Press ENTER to Quit

Desproxy reports it is listening in local port 1080 ready for a connection.

Open your favourite \s-1IRC\s0 client (install it first ;D) and connect to 127.0.0.1 port 1080 as your irc server (127.0.0.1 is a virtual \s-1IP\s0, always referencing to your local machine). Then, your \s-1IRC\s0 client should connect to desproxy. It looks like

Connection request from 127.0.0.1, port 1220 Connecting to http proxy (proxy:8080) Bidirectional connection established

Then you should be able to use your \s-1IRC\s0 client as if you were directly connected to irc.undernet.org.

How to use desproxy to log in a computer using ssh

Suppose you have a shell account in a computer that supports secure connections via ssh. Let's assume it's called shell.corporate.com. \s-1SSH\s0 uses port number 22 by default. So start a new system console and type:

desproxy shell.corporate.com 22 proxy 8080 1080

Then, tell your ssh client to connect to localhost (127.0.0.1) port 1080 and you should get a ssh password prompt!

How to use desproxy to use other static clients

Let's assume you want to use network application X, which doesn't support \s-1HTTP\s0 proxies but use one \s-1TCP/IP\s0 connection (like \s-1IRC\s0 and \s-1SSH\s0). To make X work with desproxy, you just have to 1) Search for the default port of that application 2) Search for the default server of that application and 3) Start desproxy, passing that info as command line parameters. Format is

desproxy remote_host remote_port proxy_host proxy_port local_port

Just give a local_port of your desire, but always over 1023, cause lower ports may need administrator privileges.

About \s-1HTTP\s0 Authentication

Some \s-1HTTP\s0 proxies need for security reasons a method of checking client's identity. That's called \s-1HTTP\s0 authentication (or \s-1HTTP\s0 authorization).

Despoxy now supports Basic \s-1HTTP\s0 authentication. If your proxy needs other kind of authentication (either Digest or \s-1NTLM\s0) desproxy won't work.

For desproxy to work with a \s-1HTTP\s0 proxy that needs authentication, you have to tell desproxy which username and password to use. Desproxy reads the environment variable \s-1PROXY_USER\s0 to get that info.

Suppose your proxy username is \*(L"mayka\*(R" and your proxy password is \*(L"007sgotLTK\*(R". Then, before using any of the desproxy programs you should type this in your system console:

set PROXY_USER=mayka:007sgotLTK

Beware passwords can include some characters that should be escaped from the system console. For example, if your password is \*(L"moon!=sun\*(R", and you are running Linux, you should type

export PROXY_USER=yourusername:moon\!\=sun

Note characters \*(L"!\*(R" and \*(L"=\*(R" are escaped using the backslash \*(L"\\*(R". If you are running \s-1MS\s0 Windows, as long as I know, you don't have to escape any valid password character.

head1 Troubleshooting

A normal desproxy session looks like this:

$ desproxy 127.0.0.1 21 127.0.0.1 4480 2222

----------------------------------- desproxy <version>

HTTP/1.1 (c) Miguelanxo Otero Salgueiro 2001 -----------------------------------

Listening on port 2222 Connection request from 127.0.0.1, port 1227 Connecting to http proxy (127.0.0.1:4480) Bidirectional connection stablished (127.0.0.1:21) <-> (localhost) End of connection.

Here, a connection to local ftp server (127.0.0.1:21) is made by using local proxy (127.0.0.1:4480). You can see how, after the connection is accepted, desproxy connected to the proxy, interchanged some bytes (a \s-1FTP\s0 session) and terminates the connection.

Desproxy is quite self explanatory about errors. Desproxy-inetd is far more obscure, because the way inetd uses it (can't print error messages) to the console.

Basically there are two kind of errors:

  • Errors reported when connecting to the proxy: the http page showing the error is displayed.

  • Every other error: a short error message is displayed.

Some common \s-1HTTP\s0 errors (as reported by the proxy)

* HTTP 400 Bad Request - Some versions of desproxy (0.0.21) cause this error (FATAL) * HTTP 403 Forbidden - Forbidden to do that (FATAL) * HTTP 404 Not Found - Page not found, or resource not found (MINOR) * HTTP 405 Method not Allowed - Can't do CONNECT method (FATAL) * HTTP 500 Internal Server Error - Maybe you're trying to connect to a remote closed port (remote site reported connection refused) (MINOR) * HTTP 503 Service Unavailable -> The proxy can't reach the site (MINOR) * HTTP 505 HTTP Version Not Supported - CONNECT method not available (FATAL) * HTTP 502 Bad Gateway - Stands for "DNS lookup error" (MINOR)

(\s-1FATAL\s0) - Forget about using desproxy, you can't surpass the proxy. (\s-1TODO\s0) - To do, not yet implemented. (\s-1MINOR\s0) - Temporary fault or maybe your fault.

ENVIRONMENT

\s-1PROXY_USER\s0

An example: PROXY_USER=mayka:007sgotLTK Beware passwords can include some characters that should be escaped from the system console. For example, if your password is \*(L"moon!=sun\*(R", and you are running Linux, you should type

\s-1PROXY_USER\s0

An example: PROXY_USER=yourusername:moon\!\=sun Note characters \*(L"!\*(R" and \*(L"=\*(R" are escaped using the backslash \*(L"\\*(R".

FILES

None.

RELATED TO desproxy…

dnsproxy-dns\|(1), dnsproxy-inetd\|(1), dnsproxy-socksserver\|(1), connect\|(1)

AUTHORS

This manual page was written by Jari Aalto <[email protected]>, for the Debian \s-1GNU\s0 system (but may be used by others). Released under license \s-1GPL\s0 v2 or, at your option, any later version.