| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>desproxy Readme</title> |
| 5 |
</head> |
| 6 |
<body> |
| 7 |
|
| 8 |
<h1>desproxy Readme</h1> |
| 9 |
|
| 10 |
<div align="justify"> |
| 11 |
<div align="center"><b>desproxy</b> - a TCP tunnel for HTTP proxies<br> |
| 12 |
<br> |
| 13 |
(c) 2001 Miguelanxo Otero Salgueiro<br> |
| 14 |
<a href="http://desproxy.sourceforge.net">desproxy.sourceforge.net</a><br> |
| 15 |
</div> |
| 16 |
|
| 17 |
<table cellpadding="2" cellspacing="2" border="0" width="100%"> |
| 18 |
<tbody> |
| 19 |
<tr> |
| 20 |
<td valign="top" width="10%"><br> |
| 21 |
</td> |
| 22 |
<td valign="top" width="80%"><br> |
| 23 |
|
| 24 |
<div align="justify"><b>desproxy</b> is just an answer to a question |
| 25 |
I have been wondering, for about a year: ¿Is there any way to make |
| 26 |
TCP connections trought HTTP proxies? Short answer: YES! Long answer: YES, |
| 27 |
but at the expense of decreased flexibility. Maybe it isn't useful for you |
| 28 |
(I hope that's not your case), or its too difficult for you newbie.<b> desproxy</b> |
| 29 |
just stands between your proxy and your favourite TCP application, waiting |
| 30 |
for a connection to make a TCP tunnel trought the HTTP proxy. Let's see |
| 31 |
one example<br> |
| 32 |
</div> |
| 33 |
|
| 34 |
<h2 align="justify">Real life example</h2> |
| 35 |
|
| 36 |
<div align="justify"> |
| 37 |
<div align="justify"> </div> |
| 38 |
|
| 39 |
<div align="justify">Imagine you're inside a corporation, with a HTTP/1.1 |
| 40 |
compliant proxy (<b>proxy.corporation.com:8080</b>) that is the only way |
| 41 |
to get out there... But, hey! you want to chat using your favourite irc server |
| 42 |
(<b>irc.foo.bar:6667</b> isn't that?) so you launch "desproxy" this way:<br> |
| 43 |
<tt><br> |
| 44 |
</tt> |
| 45 |
<div align="center"><tt> desproxy irc.foo.bar 6667 proxy.corporation.com |
| 46 |
8080 6667</tt><br> |
| 47 |
</div> |
| 48 |
<tt><br> |
| 49 |
</tt></div> |
| 50 |
Now, <b>desproxy</b> is listening on your local port <b>6667</b>, waiting |
| 51 |
for a connection (from your irc client). So you launch xchat, zircon... and |
| 52 |
type<br> |
| 53 |
<br> |
| 54 |
<div align="center"><tt> /server 127.0.0.1 6667<br> |
| 55 |
</tt></div> |
| 56 |
<br> |
| 57 |
xchat now tries to connect with your local port <b>6667</b>, <b>desproxy</b> |
| 58 |
"hears the bell" and after accepting the incoming connection, makes a |
| 59 |
connection to the irc server (<b>irc.foo.bar 6667</b>) trough the HTTP proxy |
| 60 |
(<b>proxy.corporation.com 8080</b>). When it gets the connection with the |
| 61 |
irc server, <b>desproxy</b> hooks the two sockets together, so xchat gets |
| 62 |
the wellcome message from the irc server as if it were connected to /server |
| 63 |
<b>irc.foo.bar 6667</b> .<br> |
| 64 |
<br> |
| 65 |
</div> |
| 66 |
|
| 67 |
<h2>Usage</h2> |
| 68 |
|
| 69 |
<div align="justify"> |
| 70 |
<div align="center"> <tt>Usage: desproxy |
| 71 |
remote_host remote_port proxy_host proxy_port local_port</tt><br> |
| 72 |
<br> |
| 73 |
</div> |
| 74 |
<b>remote_host</b> & <b>remote_port</b>: Address of the machine |
| 75 |
you want to connect to. <br> |
| 76 |
<b>proxy_host</b> & <b>proxy_port</b> : Address of the HTTP |
| 77 |
proxy.<br> |
| 78 |
<b>local_port</b> : The one in which <b>desproxy</b> will listen |
| 79 |
waiting for connections.<br> |
| 80 |
<br> |
| 81 |
</div> |
| 82 |
|
| 83 |
<h2>Programs reported to work using "desproxy"</h2> |
| 84 |
|
| 85 |
<div align="justify"> |
| 86 |
<ul> |
| 87 |
<li>telnet (OK)<br> |
| 88 |
</li> |
| 89 |
<li>ftp (not transfers, just basic commands)<br> |
| 90 |
</li> |
| 91 |
<li>ncftp (untested, should work in passive mode)<br> |
| 92 |
</li> |
| 93 |
<li>ssh & scp (OK)<br> |
| 94 |
</li> |
| 95 |
<li>popclient & fetchmail (OK)<br> |
| 96 |
</li> |
| 97 |
<li>sendmail (OK)<br> |
| 98 |
</li> |
| 99 |
<li>xchat, zircon, mIRC for windows (only basic behaviour, no |
| 100 |
DCC)<br> |
| 101 |
<br> |
| 102 |
</li> |
| 103 |
|
| 104 |
</ul> |
| 105 |
</div> |
| 106 |
|
| 107 |
<h2>Programs that WILL NOT work using "desproxy"</h2> |
| 108 |
|
| 109 |
<div align="justify"> Those that accept (or request) connections |
| 110 |
to start from the other side of the proxy (remote to local), like classic |
| 111 |
ftp (not passive).<br> |
| 112 |
<br> |
| 113 |
|
| 114 |
<h2>desproxy-inetd</h2> |
| 115 |
<b>desproxy-inetd</b> is just a flavor of desproxy that doesn't |
| 116 |
bind to a local port but reads directly from standard input (and doensn't |
| 117 |
display anything beside the raw incoming "tunnelized" connection. |
| 118 |
<br> |
| 119 |
<br> |
| 120 |
<div align="center"><tt>Usage: desproxy-inetd remote_host remote_port |
| 121 |
proxy_host proxy_port</tt><br> |
| 122 |
<br> |
| 123 |
</div> |
| 124 |
NOTE the lack of local_host. <b>desproxy-inetd</b> is designed to work |
| 125 |
like any other inetd daemon. Here is my /etc/inetd.conf line for fetchmail: |
| 126 |
<br> |
| 127 |
<br> |
| 128 |
<div align="center"><tt> pop3 stream tcp nowait mail /usr/bin/desproxy-inetd |
| 129 |
desproxy-inetd atlas.uvigo.es 110 httpproxy.uvigo.es 8080<br> |
| 130 |
</tt></div> |
| 131 |
<br> |
| 132 |
<b>desproxy-inetd</b> works great to test if your proxy supports TCP tunneling; |
| 133 |
just launch <br> |
| 134 |
<br> |
| 135 |
<div align="center"><tt>desproxy-inetd ftp.gnu.org 21 your.proxy your_proxy_port</tt><br> |
| 136 |
<br> |
| 137 |
</div> |
| 138 |
and wait to see the FTP prompt! does it work? great! NO?...<br> |
| 139 |
|
| 140 |
<h2>desproxy-socks4server</h2> |
| 141 |
<b>desproxy-socks4server</b> is a Socks version 4 server using <b> |
| 142 |
desproxy</b> . That means you can manage dinamic connections trough your |
| 143 |
HTTP proxy. For example you can use MSIE, MS Messenger, News readers, Irc |
| 144 |
clients... every application supporting a socks server/proxy.<br> |
| 145 |
|
| 146 |
<h2>desproxy-socks5server</h2> |
| 147 |
<b>desproxy-socks5server</b> is a Socks version 5 server, just like |
| 148 |
desproxy-socks4server is a Socks version 4 server.<br> |
| 149 |
|
| 150 |
<h2>desproxy-dns</h2> |
| 151 |
<b>desproxy-dns</b> is a dns forwarder using <b>desproxy</b>. It's |
| 152 |
used in conjuction with a socks server, because many clients need dns access |
| 153 |
to resolve names prior to passing them to the socks server. It supports |
| 154 |
UDP & TCP access, and forwards dns queries using TCP connections to |
| 155 |
public DNS servers. You can use any DNS server you wish, just search the |
| 156 |
web for one and give it a try!<br> |
| 157 |
|
| 158 |
<h2> Troubleshooting</h2> |
| 159 |
A normal <b>desproxy</b> session looks like this:<br> |
| 160 |
<br> |
| 161 |
<tt> miguel@Kosmos3000$ desproxy 127.0.0.1 21 127.0.0.1 4480 2222<br> |
| 162 |
-----------------------------------<br> |
| 163 |
desproxy 0.0.8<br> |
| 164 |
<br> |
| 165 |
HTTP/1.1<br> |
| 166 |
(c) Miguelanxo Otero Salgueiro 2001<br> |
| 167 |
-----------------------------------<br> |
| 168 |
<br> |
| 169 |
Listening on port 2222<br> |
| 170 |
<b> Connection request from 127.0.0.1, port 1227</b><br> |
| 171 |
Connecting to http proxy (127.0.0.1:4480)<br> |
| 172 |
Bidirectional connection stablished<br> |
| 173 |
(127.0.0.1:21) <-> (localhost)<br> |
| 174 |
proxy -> local (72) bytes<br> |
| 175 |
local -> proxy (13) bytes<br> |
| 176 |
proxy -> local (35) bytes<br> |
| 177 |
local -> proxy (14) bytes<br> |
| 178 |
proxy -> local (447) bytes<br> |
| 179 |
End of connection.<br> |
| 180 |
</tt> <br> |
| 181 |
|
| 182 |
<div align="justify"> Here, I connect to my local ftp server (127.0.0.1:21) |
| 183 |
using my local proxy (127.0.0.1:4480). You can see were the connection from |
| 184 |
another session was accepted (from 127.0.0.1 too :)), how after the connection |
| 185 |
is accepted desproxy connects to the proxy and some REAL interchange of |
| 186 |
bytes (a FTP login session).<br> |
| 187 |
</div> |
| 188 |
<br> |
| 189 |
"desproxy" is quite self explanatory about errors. "desproxy-inetd" is |
| 190 |
far more obscure, because the way inetd uses it (can't print error messages).<br> |
| 191 |
<br> |
| 192 |
Basically there are two kind of errors: |
| 193 |
<ul> |
| 194 |
<li> <b>Errors reported when connecting to the proxy</b>: the http |
| 195 |
page showing the error is displayed.<br> |
| 196 |
</li> |
| 197 |
|
| 198 |
</ul> |
| 199 |
|
| 200 |
<ul> |
| 201 |
<li> <b>Every other error</b>: a short error message is displayed.<br> |
| 202 |
</li> |
| 203 |
|
| 204 |
</ul> |
| 205 |
Errors reported by proxy may be the worse... <br> |
| 206 |
<br> |
| 207 |
|
| 208 |
<h2> Some common HTTP errors (as reported by the proxy)</h2> |
| 209 |
|
| 210 |
<ul> |
| 211 |
<li><b>HTTP 400 Bad Request</b> -> some versions of desproxy |
| 212 |
(0.0.21) cause this error (FATAL)<b><br> |
| 213 |
</b></li> |
| 214 |
<li><b>HTTP 403 Forbidden</b> -> forbidden to do that (FATAL)</li> |
| 215 |
<li><b>HTTP 404 Not Found</b> -> Page not found, or resource |
| 216 |
not found (MINOR)<br> |
| 217 |
</li> |
| 218 |
<li> <b>HTTP 405 Method not Allowed</b> -> can do CONNECT method |
| 219 |
(FATAL)</li> |
| 220 |
<li><b> HTTP 500 Internal Server Error</b> -> maybe you're trying |
| 221 |
to connect to a closed port (conenection refused) (MINOR)</li> |
| 222 |
<li> <b>HTTP 503 Service Unavailable</b> -> The proxy can't |
| 223 |
reach the site (MINOR)</li> |
| 224 |
<li> <b>HTTP 505 HTTP Version Not Supported</b> -> CONNECT method |
| 225 |
not available (FATAL)</li> |
| 226 |
<li><b> HTTP 502 Bad Gateway</b> -> Stands for "DNS lookup error" |
| 227 |
(MINOR)</li> |
| 228 |
|
| 229 |
</ul> |
| 230 |
(FATAL) -> forget about using "desproxy", you can't surpass |
| 231 |
the proxy.<br> |
| 232 |
(TODO) -> To do, not yet implemented.<br> |
| 233 |
(MINOR) -> temporary fault or maybe YOUR fault!<br> |
| 234 |
|
| 235 |
<h2>COPYING</h2> |
| 236 |
<b>desproxy</b> is licensed using the GNU GENERAL PUBLIC LICENSE. |
| 237 |
<br> |
| 238 |
Please read <a href="../COPYING">COPYING</a> for more details.<br> |
| 239 |
|
| 240 |
<h2> </h2> |
| 241 |
</div> |
| 242 |
</td> |
| 243 |
<td valign="top" width="10%" align="justify"><br> |
| 244 |
</td> |
| 245 |
</tr> |
| 246 |
|
| 247 |
</tbody> |
| 248 |
</table> |
| 249 |
|
| 250 |
<div align="justify"> <br> |
| 251 |
<br> |
| 252 |
</div> |
| 253 |
</div> |
| 254 |
|
| 255 |
<pre></pre> |
| 256 |
|
| 257 |
</body> |
| 258 |
</html> |