{"id":97,"date":"2006-03-28T17:58:00","date_gmt":"2006-03-28T17:58:00","guid":{"rendered":"http:\/\/blog.trungson.com\/?p=97"},"modified":"2006-03-28T17:58:00","modified_gmt":"2006-03-28T17:58:00","slug":"php-through-tor-and-privoxy","status":"publish","type":"post","link":"http:\/\/blog.trungson.com\/?p=97","title":{"rendered":"PHP through TOR and Privoxy"},"content":{"rendered":"<p><a href=\"http:\/\/tor.eff.org\/\">TOR<\/a> and <a href=\"http:\/\/www.privoxy.org\/\">Privoxy<\/a> can be used through PHP to enhance the privacy of your connection. First you need to setup and run both TOR (check \/etc\/torrc) and Privoxy (\/etc\/privoxy\/config, then start it as a service). If something does not work, use wget or see the error log. The PHP code below get a page through TOR network.<\/p>\n<p><textarea name=\"code\" class=\"php\"><br \/>\n<?php\n$vOpts = array('http'=>array(<br \/>\n &#8216;method&#8217;=>&#8221;GET&#8221;,<br \/>\n &#8216;request_fulluri&#8217;=>TRUE,<br \/>\n &#8216;proxy&#8217;=>&#8217;tcp:\/\/127.0.0.1:8118&#8217;,<br \/>\n &#8216;header&#8217;=>&#8221;User-Agent: Mozilla\/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko\/20051111 Firefox\/1.5\\r\\n&#8221;.&#8221;Accept-language: en\\r\\n&#8221;.&#8221;\\r\\n&#8221;<br \/>\n));<br \/>\n$vContext = stream_context_create($vOpts);<br \/>\n$vFile = file_get_contents(&#8220;http:\/\/serifos.eecs.harvard.edu\/cgi-bin\/ipaddr.pl?tor=1&#8221;,FALSE,$vContext);<br \/>\nvar_dump($vOpts,$vFile);<br \/>\n?><br \/>\n<\/textarea><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TOR and Privoxy can be used through PHP to enhance the privacy of your connection. First you need to setup and run both TOR (check \/etc\/torrc) and Privoxy (\/etc\/privoxy\/config, then start it as a service). If something does not work, use wget or see the error log. The PHP code below get a page through [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":0,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}