{"id":11,"date":"2011-09-03T15:17:53","date_gmt":"2011-09-03T15:17:53","guid":{"rendered":"http:\/\/mufljuz.com\/?p=11"},"modified":"2014-09-23T10:45:18","modified_gmt":"2014-09-23T14:45:18","slug":"socks5-proxy-and-wget","status":"publish","type":"post","link":"https:\/\/www.mufljuz.com\/?p=11","title":{"rendered":"Socks5 proxy and wget"},"content":{"rendered":"<p>I&#8217;ve tried to set wget bash loop over socks5 proxy and was surprised to find out that wget does not have included proxy support. First start your proxy tunnel on port 8080 with<br \/>\n<code><br \/>\n  ssh -o \"ServerAliveInterval 60\" -o \"ServerAliveCountMax 3\" -f -C -N -D *:8080 user@my.proxy.server &amp;&gt; tunnel.log<br \/>\n<\/code><\/p>\n<p>My firefox utilizes this tunnel perfectly &#8211; the proxy config page has the following entries:<\/p>\n<pre>\r\n  Manual proxy configuration:\r\n    SOCKS Proxy  127.0.0.1  Port 8080\r\n    \"SOCKS v5\"  checked\r\n<\/pre>\n<p>Initially I&#8217;ve tried using wget &#8211;execute to set http_proxy with<br \/>\n<code><br \/>\n  wget -e \"http_proxy = 127.0.0.1:8080\" \"http:\/\/url_to_get\"<br \/>\n<\/code><br \/>\nhowever it didn&#8217;t work giving me the following error.<\/p>\n<pre>Connecting to 127.0.0.1:8080... connected.\r\nProxy request sent, awaiting response... No data received.\r\nRetrying.<\/pre>\n<h2><strong>Wget with Tsocks<\/strong><\/h2>\n<p>The solution was to install tsocks. For gentoo just do<\/p>\n<p><code>emerge -av tsocks<\/code><\/p>\n<p>and modify the config file. Note that gentoo keeps the confing information in \/etc\/socks\/tsocks.conf, while ubuntu keeps it in \/etc\/tsocks.conf<br \/>\n<code><br \/>\nnano -w \/etc\/socks\/tsocks.conf<br \/>\n<\/code><\/p>\n<pre>server = 127.0.0.1\r\nserver_type = 5\r\nserver_port = 8080<\/pre>\n<p>If you used proxy on earlier versions of wget, remove any proxy cmds from ~\/.wgetrc<\/p>\n<p>Finally start your wget trough socks5 proxy using tsocks<br \/>\n<code><br \/>\ntsocks wget http:\/\/url_to_get<br \/>\n<\/code><\/p>\n<p>starting two tsocks wget at the same time caused my system to slow down and gave me the following error:<\/p>\n<pre>\r\nConnecting to www.ccc.ccccc|192.xxx.xxx.xxxx|:443... failed: \r\nTransport endpoint is not connected.\r\n<\/pre>\n<p>After killing one of the processes, I got back my cpu.<\/p>\n<p>Do you wanna do more? Try Tor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve tried to set wget bash loop over socks5 proxy and was surprised to find out that wget does not have included proxy support. First start your proxy tunnel on port 8080 with ssh -o &#8220;ServerAliveInterval 60&#8221; -o &#8220;ServerAliveCountMax 3&#8221; -f -C -N -D *:8080 user@my.proxy.server &amp;&gt; tunnel.log My firefox utilizes this tunnel perfectly &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,6,5,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":23,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":267,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/267"}],"wp:attachment":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}