<div>>If you want port 80 to just be relayed through - dont send it to Squid.<br><br>>You will probably be able to identify the DNS packets with your firewall<br>>rules easier than Squid can tell it apart from a mangled HTTP message.<br></div><div><br></div><div>What I want to do is to use Squid ecap adaptation to modify some http response.</div><div>But during the running time, I found that some famous mobile app using 80 port</div><div>transport some unknown protocol (not http).</div><div><br></div><div>What if the protocol is not http, but using 80 port, can squid relay it to its target server?</div><div><br></div><div><sign signid="-1"></sign></div><div><qzone></qzone></div><div> </div><div><includetail><div> </div><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Amos Jeffries"<squid3@treenet.co.nz>;</div><div><b>Date: </b> Mon, Mar 27, 2017 11:59 AM</div><div><b>To: </b> "钱国正"<richard.qian@magicwifi.com.cn>; "squid-dev"<squid-dev@lists.squid-cache.org>; <wbr></div><div></div><div><b>Subject: </b> Re: on_unsupported_protocol rewrite to support tcp connection, relay</div></div><div> </div>On 27/03/2017 3:15 p.m., 钱国正 wrote:<br>>>> I want to know what's the<br>>>> pinning.serverConnection mean? and what it is used for?<br>> <br>>> Before we dive into low-level details, please allow me to ask an<br>>> important high-level question. Your answer may render those low-level<br>>> detail irrelevant:<br>> <br>>>> I want to rewrite the on_unsupported_protocol to support tcp connection<br>>>> (non-http protocol, called httpdns not readable, no http header) and<br>>>> relay it the server. [...] I need assign the server's address and port<br>> <br>>> Where will your code get the server address and port from? If the answer<br>>> is "from the received httpdns message header", then please do not abuse<br>>> on_unsupported_protocol to support "httpdns". Instead, add proper<br>>> support for httpdns (which may be limited to forwarding httpdns queries<br>>> to the right server if such blind forwarding makes sense).<br>> <br>> No, I got it from `clientConnection->local`, the httpdns is just a tcp connection to server with<br>> specified protocol, not known to me, it is designed by its user, use 80 port to transfer dns request.<br>> <br><br>If you want port 80 to just be relayed through - dont send it to Squid.<br><br>You will probably be able to identify the DNS packets with your firewall<br>rules easier than Squid can tell it apart from a mangled HTTP message.<br><br><br>>> BTW, can you post a link to the "httpdns" protocol specification (not<br>>> API)? And what do you mean by "not readable"?<br>> <br>> <br>> <br>> It is not a standard protocol in RFC or some standard specification, just some company use <br>> 80 (default for http protocol) port to transfer dns request, they do this because in China many <br>> ISP would use they own dns server in different places which makes it slow <br>> or unreachable to the some company's service.<br>> <br><br>Then please stop calling it "httpdns". It is "DNS". Calling it "httpdns"<br>implies some relationship to HTTP other than just stealing the port number.<br><br>There is actually a protocol called HTTPDNS being designed<br>(<https://tools.ietf.org/html/draft-ietf-dnsop-dns-wireformat-http-00>).<br>Squid supports relaying that already because it uses real HTTP messages<br>on port 80.<br><br>Amos<br></div><!--<![endif]--></includetail></div>