TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

HTTP/1.1 Pipelining for DoH

1 pointsby textmodeabout 4 years ago
<p><pre><code> # requirements: # UNIX: flex, sed # me: yy025, yy048, yy049, yy050, yy051, h1b (haproxy config) # other: h2b (curveprotect), b2h (curveprotect), daemontools (envdir), ldns (drill), nc (Al Walker aka Hobbit), haproxy # todo: # eliminate requirement for drill usage=&quot;usage: ${0##*&#x2F;} DoH-server-id [RR-type (default is 01)] [httpMethod (default is GET)]&quot;; test $# -gt 0||exec echo &quot;$usage&quot;; case $1 in add_more_DoH_providers_below) ;;1)export URL=https:&#x2F;&#x2F;cloudflare-dns.com&#x2F;dns-query?dns= ;;2)export URL=https:&#x2F;&#x2F;rdns.faelix.net&#x2F;?dns= esac; ( case $3 in cloudflare_is_the_only_DoH_provider_who_supports_POST?) ;;p|post|POST) unset __close; export Accept=application&#x2F;dns-message; echo application&#x2F;dns-message &gt;ua&#x2F;1&#x2F;Content-Type; echo &gt; ua&#x2F;1&#x2F;Content-Length; echo ${URL%?*}|envdir ua&#x2F;1 yy025|b2h|sed &#x27;s&#x2F;.\{8\}$&#x2F;&#x2F;&#x27; &gt;hh3; read hh3 &lt; hh3; export hh3; type=${2-01} yy048|envdir ua&#x2F;1 yy051|h2b ;;g|get|GET|*) export Connection=keep-alive; export Accept=application&#x2F;dns-message; export nokac=1; type=${2-01} yy048|yy049|yy050|sed &quot;s&gt;.*&gt;$URL&amp;&gt;&quot;|yy025 esac; unset Accept; export httpMethod=HEAD; export Connection=close; echo https:&#x2F;&#x2F;example.com|yy025 )|nc -vv h1b 80|b2h|sed &#x27;s&#x2F;0000818&#x2F;\ &amp;&#x2F;g&#x27;|while read x;do echo $x|drill -i&#x2F;dev&#x2F;stdin 2&gt;&#x2F;dev&#x2F;null;done # alternative to using a tcp client + a tls-enabled proxy # host=$(echo $URL|yy004) # openssl s_client -connect $host:443 -ign_eof|sed &#x27;s&#x2F;0000818&#x2F; ... # most DoH servers do _not_ require SNI # but some do, e.g., Cloudflare # note Cloudflare supports ESNI # ESNI-enabled openssl is available from Stepehn Farrell at Trinity College Dublin github.com&#x2F;sftcd</code></pre>

no comments

no comments