..16-Mar-201612 KiB


ChangeLog24-Mar-201413.3 KiB

connect.c24-Mar-20142.5 KiB

direct.c24-Mar-20143.2 KiB

direct6.c24-Mar-20143.3 KiB

getopt.c24-Mar-20144.8 KiB

getopt.h24-Mar-20141.5 KiB

http.c24-Mar-20147.3 KiB


main.c24-Mar-201412.6 KiB


proxy.c24-Mar-201427.3 KiB

prtunnel.124-Mar-20146.1 KiB

prtunnel.h24-Mar-20142.8 KiB

prtunnel.mak24-Mar-20141.2 KiB

README06-Jul-20154.3 KiB

socks5.c24-Mar-20145.7 KiB


1prtunnel tunnels TCP connections through an HTTP or SOCKS5 proxy server.
2It is useful if you're behind such a proxy and want to use a program
3that doesn't have native proxy support.
5It's developed on Slackware Linux and OpenBSD (both x86), and should work
6on any other Unix-like system.
8prtunnel was written by Josh Beam <> and is distributed under
9a BSD-style license (see prtunnel.h or any other source file for the exact
10terms). The latest version can be found at
16  prtunnel [options] <local port> [<remote host> <remote port>]
18<local port> is the local port you want prtunnel to listen to; <remote host>
19is the name or address of the remote system you want to connect to;
20<remote port> is the port of the service you want to use on <remote host>.
22If run without the <remote host> and <remote port> arguments, prtunnel
23will accept SOCKS4/SOCKS5 commands from the client to determine the
24remote server to connect to.
27  -D                Run as a daemon. prtunnel will run in the background
28                    and accept multiple TCP connections with this option.
29  -V                Verbose output (prints all data transferred to standard
30                    output)
31  -c                Use color to differentiate between incoming and outgoing
32                    data in verbose output; without this, each line of outgoing
33                    verbose output will begin with ">>> " and incoming output
34                    with "<<< "
35  -6                Enables IPv6 mode. This doesn't affect the way outgoing
36                    connections are made with the direct/direct6 tunneling
37                    modes; direct will always connect with IPv4 and direct6
38                    will always connect with IPv6.
39  -t <tunnel mode>  Set tunneling mode; http (default), socks5, direct and
40                    direct6 are supported. With http and socks5, you must
41                    specify the address of an http/socks5 proxy to use.
42                    direct will make prtunnel connect directly to the remote
43                    host specified; direct6 does the same, but with IPv6
44                    instead of IPv4.
45  -H <proxy host>   Name or address of the proxy server you wish to use
46  -P <proxy port>   Port that the proxy server uses (8080 default for http,
47                    1080 default for socks5)
48  -T <address>      Add a trusted address. For security reasons, only localhost
49                    is trusted by default. Only connections from trusted
50                    addresses are allowed. You can specify an address itself
51                    (like, or in the form of address/bitcheck, where
52                    bitcheck is the number of leading bits to compare; for
53                    example, would mean any address in the range
54                    of to
55  -u <username>     Set proxy authentication username
56  -p <password>     Set proxy authentication password
57  --password-prompt
58                    Prompt for proxy username and password
59  --http-1.0        Use HTTP/1.0 instead of HTTP/1.1 for HTTP connections
60  --telnet-keep-alive <interval>
61                    Causes prtunnel to send keep-alive data at the
62                    specified interval, using the telnet NOP command
63  --crlf-keep-alive <interval>
64                    Causes prtunnel to send keep-alive data at the
65                    specified interval, using a CRLF
66  --irc-auto-pong   Causes prtunnel to automatically respond to PING commands
67                    sent by IRC servers
68  --timeout <time>
69                    Allows you to set a client socket timeout; if no data
70                    is recieved from the client for <time> seconds, the
71                    connection will be closed
72  --server-timeout <time>
73                    Allows you to set a server socket timeout; if no data
74                    is recieved from the remote host for <time> seconds,
75                    the connection will be closed
76  -h, --help        Print help message
77  -v, --version     Show version information
79Here's an example:
80  prtunnel -H proxy 6667 6667
81After starting prtunnel like this, you could then point an IRC client to
82127.0.0.1, and prtunnel will attempt to connect you to
83via the HTTP proxy server on a system named "proxy".