 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | wget with a socks proxy I've compiled wget with socks support, but the docs don't mention how to actually use it. I tried the following in ~/.wgetrc:
SOCKS=localhost:1234 (doesn't work, remote host sees my hostname not the socks proxy's hostname)
SOCKS_PROXY=localhost:1234 (doesn't work, remote host sees my hostname not the socks proxy's hostname)
HTTP_PROXY=localhost:1234 (gives error: Error parsing proxy URL localhost:1234: Unsupported scheme.)
Thanks in advance. -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|
|
|
 | said by pflog:I've compiled wget with socks support, but the docs don't mention how to actually use it. I tried the following in ~/.wgetrc: SOCKS=localhost:1234 (doesn't work, remote host sees my hostname not the socks proxy's hostname) Is the SOCKS proxy running on your machine?
Does it have a separate IP address? (not saying it must but am curious. i have a theory about the culprit but need more info) -- My server has been up longer than your server. |
|
 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | It's a socks proxy created via ssh -D 1234 user@remotehost. -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|
 | said by pflog:It's a socks proxy created via ssh -D 1234 user@remotehost. Wow. Interesting setup. I won't be much help, I'm afraid. -- My server has been up longer than your server. |
|
 | said by redhatnation:said by pflog:It's a socks proxy created via ssh -D 1234 user@remotehost. Wow. Interesting setup. I won't be much help, I'm afraid. Ok, this got in my head now.
Has this worked before? I'm wondering because even with the SSH tunnel to the remote machine running SOCKS, the tunnel is just port-based. So, wget and the remote host you're trying to access should always see your machine..maybe the SOCKS proxy port..but your machine...I think?
Oh, wtf. I'm downloading wget. Will try to duplicate your setup. -- My server has been up longer than your server. |
|
 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | No, it's never worked with wget before. It does work with firefox, though  -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|
 | said by pflog:No, it's never worked with wget before. It does work with firefox, though Yeah, I just found that out too. Very nifty tool to have.
I did find a -Y switch for wget to enable proxy usage. Supposedly, the command is wget -Y on URL.
wget man page: -Y, --proxy=on/off turn proxy on or off.
my wgetrc: HTTP_PROXY=localhost.localdomain:1234
tried localhost and my real hostname. not working yet... -- My server has been up longer than your server. |
|
 | reply to pflog From my workstation:
[~]$ wget mywebsite.url --00:16:29-- »mywebsite.url/ => `index.html' Connecting to 127.0.0.1:1234... connected. Proxy request sent, awaiting response... End of file while parsing headers. Retrying.
--00:16:30-- »mywebsite.url/ (try: 2) => `index.html' Connecting to 127.0.0.1:1234... connected. Proxy request sent, awaiting response... 00:16:30 ERROR -1: No data received.
But on the server "mywebsite.url", i'm not seeing any incoming requests. I'm checking Apache's access_log...nothing.
Hrm. -- My server has been up longer than your server. |
|
 | reply to pflog Grrr. Still not working with wget...but firefox loves it. W-T-F?
Also, tsocks installed /etc/tsocks.conf. Not sure if it has anything to do with anything.
I'm sniffing from my workstation and the remote web server. It doesn't appear wget is trying to use the ssh tunnel on port 1234. Not sure if it is a wget problem or a tsocks problem.
I'm not a SOCKS expert so I don't know if this applies: »tsocks.sourceforge.net/faq.php#bind -- My server has been up longer than your server. |
|
 | reply to pflog GOT IT!
Add this to /etc/tsocks.conf: server = 127.0.0.1 server_type = 5 server_port = 1080
in a separate terminal run: ssh REMOTESOCKSPROXY -D 1080
remove any proxy cmds from ~/.wgetrc run 'tsocks wget REMOTEURL'
Woohoo. -- My server has been up longer than your server. |
|
 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | Cool, that works. I wonder why wget doesn't seem to document how to use socks natively in wget, though?  -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|
 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | reply to redhatnation tsocks looks like a great little application. Sure beats relying on applications to do socks themselves (*cough* wget). 
Thanks again, I was more curious how to get wget to work with socks support, but this is even better. -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|
 | said by pflog:tsocks looks like a great little application. Sure beats relying on applications to do socks themselves (*cough* wget).  Thanks again, I was more curious how to get wget to work with socks support, but this is even better. Tsocks is good stuff...from what I just learned. LOL. It can proxify LOTS of applications. Was fun exploring new terrority. Thanks for the challenge.  -- My server has been up longer than your server. |
|
 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | Yeah, definitely looks like a nice little package. Looks like it sets LD_PRELOAD to its lib, then intercepts socket calls or something like that, allowing it to work with many tcp applications, even if they don't support socks. Thanks for the pointer to it, I'll have to play with it some more.  -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|
 pflogBueller? Bueller?Premium,MVM join:2001-09-01 El Dorado Hills, CA kudos:3 | reply to redhatnation One thing I've noticed so far is that it doesn't seem to work for graphical things (at least the ones I've tried). e.g.:
tsocks firefox »google.com
Doesn't work. In fact, if you just:
export LD_PRELOAD=/usr/lib/libtsocks.so
then try to fire up anything non-CLI, it seems to hang. -- $(perl -e 'print pack("H*","6d616e207065726c0a")') |
|