<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>So I'm thinking putting the tor daemon behind some third party TCP proxy that will protect me from this kind of DDoS attack.</div><div><br></div><div>What
 do you think if I want to implement a feature that forward all the 
onion service traffic to the TCP proxy before going to the Tor network?</div><div><br></div><div>The protocol that I'm thinking is TCP Proxy Protocol [1]</div><div><br></div><div>[1] <a href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt" target="_blank">https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt</a></div></div></div></div></blockquote><br><div>You could try the existing HTTPSProxy torrc option?</div><div><br></div><div><dl><dt class="gmail-m_-2116091595766822615hdlist1" style="margin:0px 0px 10px;padding:0px;border:0px none;outline:currentcolor none 0px;font-weight:bold;vertical-align:baseline;line-height:28px"><span style="background-color:rgba(255,255,255,0)"><b style="margin:0px;padding:0px;border:0px none;outline:currentcolor none 0px;font-style:inherit;vertical-align:baseline">HTTPSProxy</b> <span style="margin:0px;padding:0px;border:0px none;outline:currentcolor none 0px;font-weight:inherit;font-style:italic;vertical-align:baseline">host</span>[:<span style="margin:0px;padding:0px;border:0px none;outline:currentcolor none 0px;font-weight:inherit;font-style:italic;vertical-align:baseline">port</span>]</span></dt><dd style="margin:0px 0px 18px;padding:0px;border:0px none;outline:currentcolor none 0px;vertical-align:baseline;line-height:20px"><p style="margin:0px 0px 18px;padding:0px;border:0px none;outline:currentcolor none 0px;font-style:inherit;vertical-align:baseline;line-height:20px"><span style="background-color:rgba(255,255,255,0)">Tor will make all its OR (SSL) connections through this host:port (or host:443 if port is not specified), via HTTP CONNECT rather than connecting directly to servers. You may want to set <b style="margin:0px;padding:0px;border:0px none;outline:currentcolor none 0px;font-style:inherit;vertical-align:baseline">FascistFirewall</b> to restrict the set of ports you might try to connect to, if your HTTPS proxy only allows connecting to certain ports.</span></p><p style="margin:0px 0px 18px;padding:0px;border:0px none;outline:currentcolor none 0px;font-style:inherit;vertical-align:baseline;line-height:20px"><span style="background-color:rgba(255,255,255,0)"><br></span></p><p style="margin:0px 0px 18px;padding:0px;border:0px none;outline:currentcolor none 0px;font-style:inherit;vertical-align:baseline;line-height:20px">Tor also allows an intelligent firewall to filter circuits using a field in haproxy protocol format, see <b style="margin:0px;padding:0px;border:0px none;outline:currentcolor none 0px;vertical-align:baseline;background-color:rgba(255,255,255,0)">HiddenServiceExportCircuitID</b><span style="background-color:rgba(255,255,255,0)"> for details. But you probably won't need this advanced feature.</span></p></dd></dl></div></div></blockquote><div><br></div><div>I feel that HTTPSProxy is too expensive. As far as I know, it needs to do (1) tcp handshake, (2) tls handshake, and (3) http connect. If I can use haproxy, it would be just one tcp handshake.</div><div><br></div><div>Could I propose another option for haproxy?</div><div>I can do it myself. You just review and merge :)</div><div><br></div><div>Haxxpop<br></div></div></div>