Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Hacking OpenAI(hacktron.ai ↗)
    122comments
  2. Jemalloc 5.4.0(github.com/jemalloc ↗)
    18comments
  3. Astra for Law(openai.com ↗)
    488comments
  4. The scourge of x86 emulation(fex-emu.com ↗)
    9comments
  5. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    118comments
  6. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    205comments
  7. Qwen 3.8 Omni Flash(qwen.ai ↗)
    60comments
  8. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    25comments
  9. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    159comments
  10. Wax motor(wikipedia.org ↗)
    63comments
  11. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    221comments
  12. Shapelearn Qwen 3.8 27B (13.1 GB VRAM)(byteshape.com ↗)
    5comments
  13. When the fractional part of a float fixes your shader(crocidb.com ↗)
    discuss
  14. How to Write with an LLM(sockpuppet.org ↗)
    81comments
  15. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    21comments
  16. Flet 1.0 – Build cross-platform apps in Python(flet.dev ↗)
    51comments
  17. Apple detectives solved mystery of ancient tree and rewrote the history of fruit(scientificamerican.com ↗)
    4comments
  18. Ask A Monk – A digital wilderness for thoughts with no immediate answer(askamonk.online ↗)
    20comments
  19. Diplodocus, Long Thought Exclusively American, Turns Up in Spain(sci.news ↗)
    36comments
  20. The most important product decision is what you don't build(liamnugent.me ↗)
    32comments
  21. Fixing an NZXT Signal 4K30 part 2: the green/pink video bug(downtowndougbrown.com ↗)
    8comments
  22. Waymo in Singapore(waymo.com ↗)
    107comments
  23. CrowdSec Source Code Leak(crowdsec.net ↗)
    44comments
  24. How do we prevent mathemathics from devolving into the Medieval Era of secrecy?(mathoverflow.net ↗)
    94comments
  25. Why I didn’t sign the Fields medallists’ letter(gowers.wordpress.com ↗)
    354comments
  26. How Uber Protects Against Retry Storms(uber.com ↗)
    35comments
  27. Show HN: Snapdrop: Instantly share files between devices. No setup, no signup(snapdrop.me ↗)
    34comments
  28. Infinite-Parameter LLMs: Generating and Adapting Weights from Live Data(arxiv.org ↗)
    39comments
  29. Khipu (Quipu) Field Guide(khipufieldguide.com ↗)
    discuss
  30. Code Scans(devin.ai ↗)
    4comments

Show HN: Using CNAMEs as SNI Hostnames

1 pointsby 6y ago
1 comments
#A shell script that "learns" and updates itself with new information.

#Usage: echo https://example.com/index.html|cname-sni > 1.html; firefox 1.html [1]

#where example.com is a site hosted on AWS Cloudfront and the script is called "cname-sni".

#Purpose: send CNAME as SNI hostname, e.g., send dnere6g15e5vs.cloudfront.net instead of www.reuters.com

#Uses DNS-over-HTTPS from Cloudflare but can easily substitute other sources

# echo 104.16.248.249 cloudflare-dns.com >> /etc/hosts

#1. The file 1.html will contain TLS headers, HTTP headers and possibly chunk sizes. Removing those is left as an exercise for the reader. I wrote some crude filters in flex to do it. Adding "<base href=https://example.com />" to the top of 1.html will fix relative links when viewed in the browser.

    # requirements:  ed, grep, sed, openssl ; 
    get(){ printf "GET $1 HTTP/1.1\r\nHost: $2\r\nConnection: close\r\n\r\n"|exec openssl s_client -ign_eof -no_ticket -connect $2:443 -verify 9 $3 $4 $5;}
    doh(){ u=cloudflare-dns.com;get "/dns-query?name=$1&type=A&ct=application/dns-json" $u |grep  -o "d[^\"]*.cloudfront.net";};
    read x q; unset q;case $x in https://*)x=${x#*https://};esac;host=${x%%/*};path=/${x#*/};
    case $host in "") # the ";;" lines are eight spaces from the left margin and there are eight spaces following grep and echo
        ;;www.reuters.com) y=dnere6g15e5vs.cloudfront.net
        ;;www.wsj.com) y=dlp0y1mxy0v3u.cloudfront.net
        ;;*) a=$(doh $x|sed 1q);
    echo $a|grep -q "^d[^\"]*.cloudfront.net$" ||exit;
    z=$a;if ! grep -q '        ;;$host) 'y=$z $0;then echo '        ;;'$host')' y=$z >> $0;
    printf "/doh .x\n-1\n\$m.\nwq\n"|ed $0 >/dev/null;fi;esac;get $path $x -tls1_2 -servername ${z-$y};exit
6y agoHN ↗

   sed -i '/read x/s,$,test \$path != \$x||path=/\;,' cname-sni