{"id":1091,"date":"2019-04-13T20:45:11","date_gmt":"2019-04-13T12:45:11","guid":{"rendered":"https:\/\/freesilo.com\/?p=1091"},"modified":"2019-04-13T21:14:31","modified_gmt":"2019-04-13T13:14:31","slug":"wget-%e4%bd%bf%e7%94%a8sock5%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/freesilo.com\/?p=1091","title":{"rendered":"wget \u4f7f\u7528sock5\u4ee3\u7406"},"content":{"rendered":"<div>\n<h4>\u5bf9 debian \u7cfb linux \uff0c\u53ef\u4ee5\u901a\u8fc7tsocks \u5b9e\u73b0\u3002<\/h4>\n<p>\u9996\u5148\u5b89\u88c5tsocks\uff1a<br \/>\n<code>$ sudo apt install tsocks<\/code><br \/>\n\u7136\u540e\u4fee\u6539tsocks\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<br \/>\n<code>$ sudo vim \/etc\/tsocks.conf<\/code><br \/>\n<code>server = 127.0.0.1<br \/>\nserver_type = 5<br \/>\nserver_port = 1080<br \/>\n<\/code><br \/>\n\u8bbe\u7f6e\u4ee3\u7406\u670d\u52a1\u5668\u5730\u5740\uff0c\u7c7b\u578b\uff0c\u7aef\u53e3\u3002<\/p>\n<h4>wget \u5957\u4e0a tsocks \u8fd0\u884c\uff0c\u5c31\u53ef\u4ee5\u8bbf\u95ee\u4ee3\u7406\u4e86\uff08\u5982\u679c\u4e4b\u524d\u8bbe\u7f6e\u4e86 http \u4ee3\u7406\uff0c\u8981\u5148\u6e05\u9664\u6389\uff09\u3002<\/h4>\n<pre class=\"hljs cpp\"><code class=\"cpp\">tsocks wget http:<span class=\"hljs-comment\">\/\/\u2026\u2026<\/span><\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3>\u8865\u51451\uff1a<\/h3>\n<p>\u4f7f\u7528<span lang=\"en-us\" xml:lang=\"en-us\">tsocks:<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks [application [applications arguments]]<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks [on|off]<\/span><\/p>\n<p>\u4e3e\u51e0\u4e2a\u5b9e\u4f8b\u5427\uff1a<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks firefox\u00a0\u00a0\u00a0#<\/span>\u4e4b\u540e\u518d<span lang=\"en-us\" xml:lang=\"en-us\">firefox<\/span>\u4e0a\u6d4f\u89c8\u7f51\u9875\u5c31\u4f1a\u9ed8\u8ba4\u4f7f\u7528<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u914d\u7f6e\u7684\u4ee3\u7406<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks git clone git:\/\/github.com\/avikivity\/kvm.git #<\/span>\u4f7f\u7528<span lang=\"en-us\" xml:lang=\"en-us\">proxy<\/span>\u6765<span lang=\"en-us\" xml:lang=\"en-us\">git<\/span>\uff0c\u8fd9\u5c31\u662f\u6211\u7528\u7684\u539f\u56e0<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">\u00a0<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">source tsocks on\u00a0\u00a0#<\/span>\u8bbe\u7f6e\u5f53\u524d<span lang=\"en-us\" xml:lang=\"en-us\">shell<\/span>\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\uff0c\u8be5\u547d\u4ee4\u53ef\u80fd\u9047\u5230\u4e00\u4e2a\u5c0f<span lang=\"en-us\" xml:lang=\"en-us\">bug<\/span>\u5728\u4e0b\u9762\u6709\u8bb2\u5230<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks show\u00a0\u00a0\u00a0\u00a0\u00a0#<\/span>\u67e5\u770b\u5f53\u524d<span lang=\"en-us\" xml:lang=\"en-us\">Shell<\/span>\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u8bbe\u7f6e\uff0c<span lang=\"en-us\" xml:lang=\"en-us\">tsocks: This shell is socksified.<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">do_something\u00a0\u00a0\u00a0\u00a0#<\/span>\u8fd9\u91cc\u5c31\u80fd\u9ed8\u8ba4\u4f7f\u7528<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u7684\u4ee3\u7406\u53bb<span lang=\"en-us\" xml:lang=\"en-us\">do something<\/span>\u4e86\uff0c\u524d\u9762\u5df2\u7ecf\u8bbe\u7f6e\u4e86<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">source tsocks off\u00a0\u00a0#<\/span>\u5173\u95ed\u5f53\u524d<span lang=\"en-us\" xml:lang=\"en-us\">shell<\/span>\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u4ee3\u7406\u8bbe\u7f6e<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks show\u00a0\u00a0\u00a0\u00a0\u00a0#<\/span>\u518d\u6b21\u67e5\u770b\uff0c<span lang=\"en-us\" xml:lang=\"en-us\">tsocks: This shell is NOT socksified.<\/span><\/p>\n<p>\u9047\u5230\u7684\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">13:01:17 libtsocks(2432): SOCKS server proxy-shz.intel.com (10.239.120.36) is not on a local subnet!<br \/>\n<\/span>\u8bbe\u7f6e\u7684\u4ee3\u7406\u6ca1\u6709\u4e0e<span lang=\"en-us\" xml:lang=\"en-us\">\/etc\/tsocks.conf<\/span>\u6587\u4ef6\u4e2d\u7684<span lang=\"en-us\" xml:lang=\"en-us\">local<\/span>\u8bbe\u7f6e\u7684\u7f51\u7edc\u5728\u540c\u4e00\u4e2a\u5b50\u7f51\u4e2d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">3:03:26 libtsocks(2451): The SOCKS server (proxy.ABCD.com) listed in the configuration file which needs to be used for this connection is invalid<br \/>\n<\/span>\u914d\u7f6e\u6587\u4ef6\u7684\u95ee\u9898\uff0c\u6211\u4e5f\u5fd8\u4e86\u662f\u5565\u65f6\u51fa\u73b0\u7684\u9519\u8bef\u4e86\uff0c\u4f46\u6211\u78b0\u5230\u8fc7\u7684\u3002<span lang=\"en-us\" xml:lang=\"en-us\"><br \/>\n13:02:50 libtsocks(2441): Error 110 attempting to connect to SOCKS server (Connection timed out)<br \/>\n<\/span>\u8fd9\u4e2a\u5f88\u660e\u663e\u4e86\uff0c\u5c31\u662f\u4f60\u8bbe\u7f6e\u7684<span lang=\"en-us\" xml:lang=\"en-us\">proxy<\/span>\u8fde\u63a5\u4e0d\u4e0a\uff08\u53ef\u80fd\u662f\u672c\u6765\u5c31\u8fde\u4e0d\u4e0a\uff0c\u6216\u8005\u6ca1\u5728\u540c\u4e00\u4e2a\u5c40\u57df\u7f51\u5185\uff09\uff0c\u8bf7\u68c0\u67e5\u548c\u786e\u8ba4\u914d\u7f6e\u3002<\/p>\n<p>ERROR: ld.so: object &#8216;\/lib64\/libtsocks.so&#8217; from LD_PRELOAD cannot be preloaded: ignored.<br \/>\n\u90c1\u95f7\u574f\u4e86\uff0c\u662f\u56e0\u4e3a\u6709\u4e00\u6b21\u6211\u5728<span lang=\"en-us\" xml:lang=\"en-us\">rhel5u5<\/span>\u4e0a\u5b89\u88c5\u4e86\u4e00\u4e2a<span lang=\"en-us\" xml:lang=\"en-us\">rhel6<\/span>\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsock\u00a0rpm<\/span>\u5305\uff0c\u89e3\u51b3\u529e\u6cd5\u662f\u5230<span lang=\"en-us\" xml:lang=\"en-us\">http:\/\/pkgs.org\/<\/span>\u627e\u5230\u4e00\u4e2a<span lang=\"en-us\" xml:lang=\"en-us\">tsocks\u00a0for\u00a0rhel5<\/span>\u7684<span lang=\"en-us\" xml:lang=\"en-us\">rpm<\/span>\u5305\uff0c\u5b89\u88c5\u5373\u53ef\u3002<\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">\u00a0<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">[root@kvm-build ~]# source \/usr\/bin\/tsocks on<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">basename: invalid option &#8212; &#8216;b&#8217;<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">Try `basename &#8211;help&#8217; for more information.<\/span><\/p>\n<p>\u770b\u5230\u8fd9\u6837\u7684\u9519\u8bef\uff0c\u6709\u53ef\u80fd\u662f\u4f60\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u6709\u70b9\u5c0f<span lang=\"en-us\" xml:lang=\"en-us\">bug<\/span>\uff0c\u4e0d\u8fc7\u4e0d\u5f71\u54cd\u4f7f\u7528\u7684\uff0c\u63a5\u7740\u4f60\u7528<span lang=\"en-us\" xml:lang=\"en-us\">tsocks show<\/span>\u6765\u770b\uff0c\u4e00\u6837\u53ef\u4ee5\u770b\u5230\u63d0\u793a\u8bf4<span lang=\"en-us\" xml:lang=\"en-us\">socks<\/span>\u8bbe\u7f6e\u6210\u529f\u7684\uff0c<span lang=\"en-us\" xml:lang=\"en-us\">tsocks: This shell is socksified.<\/span><\/p>\n<p>\u6211\u7684<span lang=\"en-us\" xml:lang=\"en-us\">rhel5<\/span>\u548c<span lang=\"en-us\" xml:lang=\"en-us\">rhel6<\/span>\u4e2d\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u90fd\u9047\u5230\u8fd9\u6837\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u4f60\u53ef\u4ee5\u7b80\u5355\u5730\u4fee\u6539\u4e00\u4e0b<span lang=\"en-us\" xml:lang=\"en-us\">\/usr\/bin\/tsocks<\/span>\u6587\u4ef6\uff0c\u5c06\u5176\u4e2d\u7684<span lang=\"en-us\" xml:lang=\"en-us\">basename<\/span>\u7684\u4e00\u884c\u4fee\u6539\u4e00\u4e0b\u5373\u53ef\uff1a<\/p>\n<p>\u4fee\u6539\u524d\uff1a<span lang=\"en-us\" xml:lang=\"en-us\">PRG=&#8221;$(basename $0)&#8221;<\/span><\/p>\n<p>\u4fee\u6539\u4e3a\uff1a<span lang=\"en-us\" xml:lang=\"en-us\">PRG=&#8221;$(basename &#8212; $0)&#8221;<\/span><\/p>\n<p>\u8fd9\u662f\u7531\u4e8e\u8fd9\u4e2a<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u5199\u540e\uff0c<span lang=\"en-us\" xml:lang=\"en-us\">coreutils<\/span>\u5de5\u5177\u505a\u4e86\u4e9b\u6539\u52a8\uff0c\u5176\u4e2d<span lang=\"en-us\" xml:lang=\"en-us\">basename<\/span>\u5de5\u5177\u9700\u8981\u7528<span lang=\"en-us\" xml:lang=\"en-us\">\u201d&#8211;\u201c<\/span>\u6765\u8868\u793a<span lang=\"en-us\" xml:lang=\"en-us\">options<\/span>\u7684\u7ed3\u675f\uff08\u4e3a\u4e86\u4fdd\u6301\u65b0\u8001\u7248\u672c\u7684\u517c\u5bb9\uff09\u3002\u8fd9\u4e2a\u95ee\u9898\u5728<span lang=\"en-us\" xml:lang=\"en-us\">Bug-coreutils mailing list<\/span>\u4e2d\u8ba8\u8bba\u8fc7\u4e86\u7684\uff0c\u89c1\uff1a<span lang=\"en-us\" xml:lang=\"en-us\">http:\/\/www.mail-archive.com\/bug-coreutils@gnu.org\/msg09912.html<\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\"><br \/>\n<\/span>\u66ff\u4ee3\u5de5\u5177\u673a\u53c2\u8003\u6587\u6863\uff1a<\/p>\n<p>\u4e00\u4e2a\u4e0e<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u6709\u7c7b\u4f3c\u529f\u80fd\u7684\u5de5\u5177<span lang=\"en-us\" xml:lang=\"en-us\">: socat\u00a0\u00a0\u00a0<\/span>\uff08\u6211\u6682\u65f6\u6ca1\u600e\u4e48\u7528\uff09<\/p>\n<p>\u89c1\uff1a<span lang=\"en-us\" xml:lang=\"en-us\"><a href=\"http:\/\/freshmeat.net\/projects\/socat\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/freshmeat.net\/projects\/socat\/<\/a><\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks.conf<\/span>\u914d\u7f6e\u6587\u4ef6\uff1a<span lang=\"en-us\" xml:lang=\"en-us\"><a href=\"http:\/\/linux.die.net\/man\/5\/tsocks.conf\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/linux.die.net\/man\/5\/tsocks.conf<\/a><\/span><\/p>\n<p><span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u7684\u4f7f\u7528\uff1a<span lang=\"en-us\" xml:lang=\"en-us\"><a href=\"http:\/\/www.21andy.com\/blog\/20100212\/1678.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/www.21andy.com\/blog\/20100212\/1678.html<\/a><br \/>\n<\/span>\u53e6\u5916\u7684\u4eba\u9047\u5230\u7684<span lang=\"en-us\" xml:lang=\"en-us\">tsocks<\/span>\u95ee\u9898\uff1a<span lang=\"en-us\" xml:lang=\"en-us\"><a href=\"http:\/\/notes.benv.junerules.com\/socks-opera-and-brute-force\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/notes.benv.junerules.com\/socks-opera-and-brute-force\/<\/a><\/span><\/p>\n<div><span lang=\"en-us\" xml:lang=\"en-us\">\u00a0<\/span><\/div>\n<div><span lang=\"en-us\" xml:lang=\"en-us\">\u00a0<\/span><\/div>\n<div>\u5b89\u88c5tsocks\u89c1\u00a0http:\/\/pkgs.org\/centos-6\/epel-x86_64\/tsocks-1.8-0.5.beta5.el6.x86_64.rpm.html<\/div>\n<div><\/div>\n<h3>\u8865\u51452\uff1a<\/h3>\n<p>wget\u4f7f\u7528HTTP\u4ee3\u7406\u6a21\u5f0f\uff1a<br \/>\n\u4f8b\u5982\uff1a<br \/>\n<code>wget -c -r -np -k -L -p -e \"http_proxy=http:\/\/127.0.0.1:8080\" http:\/\/www.subversion.org.cn\/svnbook\/1.4\/<\/code><br \/>\n\u8fd9\u79cd\u65b9\u5f0f\u5bf9\u4e8e\u4f7f\u7528\u4e00\u4e2a\u4e34\u65f6\u4ee3\u7406\u5c24\u4e3a\u65b9\u4fbf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9 debian \u7cfb linux \uff0c\u53ef\u4ee5\u901a\u8fc7tsocks \u5b9e\u73b0\u3002 \u9996\u5148\u5b89\u88c5tso&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/freesilo.com\/?p=1091\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1091","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts\/1091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1091"}],"version-history":[{"count":5,"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts\/1091\/revisions"}],"predecessor-version":[{"id":1097,"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts\/1091\/revisions\/1097"}],"wp:attachment":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}