{"id":2032,"date":"2019-02-03T14:44:23","date_gmt":"2019-02-03T13:44:23","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=2032"},"modified":"2019-02-18T17:54:40","modified_gmt":"2019-02-18T16:54:40","slug":"transparent-proxy","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=2032","title":{"rendered":"Transparent TCP proxy"},"content":{"rendered":"<p>Still playing with Windivert (see original article <a href=\"https:\/\/labalec.fr\/erwan\/?p=2013\" rel=\"noopener\" target=\"_blank\">here<\/a>), I this time decided to code a transparent proxy.<\/p>\n<p>Principle is the following : divert a destination port (say tcp:80) to a new destination_ip:port.<\/p>\n<p>On the destination ip, i am running <a href=\"https:\/\/www.privoxy.org\/\" rel=\"noopener\" target=\"_blank\">privoxy <\/a>(but any proxy supporting transparent mode would do).<br \/>\nIn privoxy config file, I am setting accept-intercepted-requests=1 .<\/p>\n<p>This will be completely transparent for the source application.<\/p>\n<p>Nothing really fancy in the code except may be me storing the orginal remote ip (which we will need to re apply on the traffic back) in an array dynamic_source_port=remote_ip.<\/p>\n<p>Source code and binaries can be found <a href=\"https:\/\/github.com\/erwan2212\/windivert-fpc\" rel=\"noopener\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Still playing with Windivert (see original article here), I this time decided to code a transparent proxy. Principle is the following : divert a destination port (say tcp:80) to a new destination_ip:port. On the destination ip, i am running privoxy (but any proxy supporting transparent mode would do). In privoxy config file, I am setting <a href='https:\/\/labalec.fr\/erwan\/?p=2032' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[105],"class_list":["post-2032","post","type-post","status-publish","format-standard","hentry","category-network","tag-windivert","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/2032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2032"}],"version-history":[{"count":5,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/2032\/revisions"}],"predecessor-version":[{"id":2071,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/2032\/revisions\/2071"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}