File: desproxy.1.pod

package info (click to toggle)
desproxy 0.1.0~pre3-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 412 kB
  • ctags: 251
  • sloc: ansic: 1,753; makefile: 123; sh: 29
file content (340 lines) | stat: -rw-r--r-- 10,183 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
#  This is manual page in Perl POD format. Read more at
#  http://perldoc.perl.org/perlpod.html or run command:
#
#     perldoc perlpod | less
#
#  To check the syntax:
#
#     podchecker *.pod
#
#  Create manual page with command:
#
#    pod2man PAGE.N.pod > PAGE.N

=pod

=head1 NAME

desproxy - a TCP tunnel for HTTP proxies

=head1 SYNOPSIS

  desproxy remote_host remote_port proxy_host proxy_port local_port

=head1 OPTIONS

None.

=head1 DESCRIPTION

HTTP proxies are network servers that are used to give HTTP (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. HTTP 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...)

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

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

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

=over 4

=item *

ICMP is used to manage large IP networks. The only application using
ICMP you may miss is ping.

=item *

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

=back

=head2 Will desproxy work with my HTTP proxy?

Short answer: just give it a try

Long answer: desproxy should work with every HTTP proxy, with the
following exceptions:

=over 4

=item *

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

=item *

HTTP/1.0 Proxies. Desproxy needs the CONNECT method, which is only
available from HTTP/1.1 protocol version. It's very unlikely your
proxy doesn't accept HTTP/1.1 requests.

=item *

HTTP/1.1 Proxies without the CONNECT method. Maybe your network
administrator deactivated CONNECT support in the proxy, or maybe
CONNECT is restricted to the HTTPS port (443).

=back

=head2 Assumptions

Let's assume the following:

=over 4

=item *

your HTTP proxy host name is "proxy" and its address is "192.0.0.1"

=item *

your HTTP proxy port is "8080"

=item *

your HTTP proxy doesn't need authentication. It case you need HTTP
authentication, please read [2]this.

=item *

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

=back

=head2 About connections

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

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 "dynamic connections".

=head1 STATIC CONNECTIONS EXAMPLES

=head2 item How to use desproxy to connect to IRC

Suppose you want to connect to IRC using irc.undernet.org port 6667 as
your IRC 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 IRC 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 IP,
always referencing to your local machine). Then, your IRC 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 IRC client as if you were directly
connected to irc.undernet.org.

=head2 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. SSH
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!

=head2 How to use desproxy to use other static clients

Let's assume you want to use network application X, which doesn't
support HTTP proxies but use one TCP/IP connection (like IRC and SSH).
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.

=head2 About HTTP Authentication

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

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

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

Suppose your proxy username is "mayka" and your proxy password is
"007sgotLTK". 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 "moon!=sun",
and you are running Linux, you should type

    export PROXY_USER=yourusername:moon\!\=sun

Note characters "!" and "=" are escaped using the backslash "\". If you
are running MS 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
FTP 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:

=over 4

=item *

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

=item *

Every other error: a short error message is displayed.

=back

Some common HTTP 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)

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

=head1 ENVIRONMENT

=over 4

=item PROXY_USER

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 "moon!=sun",
and you are running Linux, you should type

=item PROXY_USER

An example:

    PROXY_USER=yourusername:moon\!\=sun

Note characters "!" and "=" are escaped using the backslash "\".

=back

=head1 FILES

None.

=head1 SEE ALSO

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

=head1 AUTHORS

This manual page was written by Jari Aalto <jari.aalto@cante.net>, for
the Debian GNU system (but may be used by others). Released under
license GPL v2 or, at your option, any later version.

=cut