{"id":155386,"date":"2020-08-30T08:11:01","date_gmt":"2020-08-30T00:11:01","guid":{"rendered":"http:\/\/4563.org\/?p=155386"},"modified":"2020-08-30T08:11:01","modified_gmt":"2020-08-30T00:11:01","slug":"tinyproxy-%e5%9c%a8%e5%a4%9a%e7%bd%91%e5%8d%a1%e7%bb%91%e5%ae%9a%e9%9d%9e%e4%b8%bb%e8%b7%af%e7%94%b1%e7%bd%91%e5%8d%a1%e7%9a%84%e6%97%b6%e5%80%99%e5%9b%9e%e7%a8%8b%e6%97%a0%e6%95%b0%e6%8d%ae%ef%bc%8c","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=155386","title":{"rendered":"tinyproxy \u5728\u591a\u7f51\u5361\u7ed1\u5b9a\u975e\u4e3b\u8def\u7531\u7f51\u5361\u7684\u65f6\u5019\u56de\u7a0b\u65e0\u6570\u636e\uff0c\u8be5\u6392\u67e5\u54ea\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  tinyproxy \u5728\u591a\u7f51\u5361\u7ed1\u5b9a\u975e\u4e3b\u8def\u7531\u7f51\u5361\u7684\u65f6\u5019\u56de\u7a0b\u65e0\u6570\u636e\uff0c\u8be5\u6392\u67e5\u54ea\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : phpfpm <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>proxy \u7684\u8def\u7531\u8868\uff1a<\/p>\n<pre><code>[email&#160;protected]:\/etc\/tinyproxy# ip route default via 192.168.0.1 dev enp2s0 172.17.0.0\/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 192.168.0.0\/24 dev enp2s0 proto kernel scope link src 192.168.0.138 192.168.20.0\/24 dev wlp4s0 proto kernel scope link src 192.168.20.112 <\/code><\/pre>\n<p>tinyproxy \u7684\u914d\u7f6e\uff1a<\/p>\n<pre><code>Port 8888 Listen 192.168.0.138 Bind 192.168.20.112 #BindSame yes <\/code><\/pre>\n<p>curl via proxy \u7684\u73b0\u8c61\uff1a<\/p>\n<pre><code>$ curl https:\/\/xxx\/ip -x http:\/\/proxy.server:8888 -vvv *   Trying 192.168.0.138:8888... * TCP_NODELAY set * Connected to proxy.server (192.168.0.138) port 8888 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to xxx:443 &gt; CONNECT xxx:443 HTTP\/1.1 &gt; Host: xxx:443 &gt; User-Agent: curl\/7.68.0 &gt; Proxy-Connection: Keep-Alive &gt;  * Proxy CONNECT aborted * CONNECT phase completed! * Closing connection 0 curl: (56) Proxy CONNECT aborted  <\/code><\/pre>\n<p>\u6240\u4ee5\u603b\u7ed3\u4e00\u4e0b\u73b0\u8c61\u662f proxy.server \u7684 8888 \u7aef\u53e3\u53ef\u4ee5\u8fde\u4e0a\uff0c\u53bb\u7a0b ok\uff0c\u56de\u7a0b\u6302\u4e86\u3002<\/p>\n<p>tinyproxy \u7684 log\uff1a<\/p>\n<pre><code>INFO      Sep 12 07:31:21 [410600]: Initializing tinyproxy ... INFO      Sep 12 07:31:21 [410600]: Reloading config file INFO      Sep 12 07:31:21 [410600]: Added address [192.168.0.138] to listen addresses. INFO      Sep 12 07:31:21 [410600]: Outgoing connections bound to IP 192.168.20.112 INFO      Sep 12 07:31:21 [410600]: Setting \"Via\" header to 'tinyproxy' INFO      Sep 12 07:31:21 [410600]: Adding Port [443] to the list allowed by CONNECT INFO      Sep 12 07:31:21 [410600]: Adding Port [563] to the list allowed by CONNECT INFO      Sep 12 07:31:21 [410600]: listen_sock called with addr = '192.168.0.138' INFO      Sep 12 07:31:21 [410600]: trying to listen on host[192.168.0.138], family[2], socktype[1], proto[6] INFO      Sep 12 07:31:21 [410600]: listening on fd [0] INFO      Sep 12 07:31:21 [410600]: Now running as group \"tinyproxy\". INFO      Sep 12 07:31:21 [410600]: Now running as user \"tinyproxy\". INFO      Sep 12 07:31:21 [410600]: Setting the various signals. INFO      Sep 12 07:31:21 [410600]: Creating child number 1 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 2 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 3 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 4 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 5 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 6 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 7 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 8 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 9 of 10 ... INFO      Sep 12 07:31:21 [410600]: Creating child number 10 of 10 ... INFO      Sep 12 07:31:21 [410600]: Finished creating all children. CONNECT   Sep 12 07:31:26 [410602]: Connect (file descriptor 6): web.server [192.168.0.178] CONNECT   Sep 12 07:31:26 [410602]: Request (file descriptor 6): CONNECT xxx:443 HTTP\/1.1 INFO      Sep 12 07:31:26 [410602]: No upstream proxy for xxx INFO      Sep 12 07:31:26 [410602]: opensock: opening connection to xxx:443 INFO      Sep 12 07:31:26 [410602]: opensock: getaddrinfo returned for xxx:443 ERROR     Sep 12 07:33:37 [410602]: opensock: Could not establish a connection to xxx INFO      Sep 12 07:33:37 [410602]: no entity <\/code><\/pre>\n<p>emm \u770b\u8d77\u6765\u662f opensock \u7684\u95ee\u9898\u4e48\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>tinyproxy \u5728\u591a\u7f51\u5361\u7ed1\u5b9a\u975e&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/155386"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155386"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/155386\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155386"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}