Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Bend 2 and the Vibe-Coding Trap(liampwll.com ↗)
    5comments
  2. OpenJev(openjev.com ↗)
    111comments
  3. ZCode, the GLM coding agent, silently uploads your Git history(tokenstead.ai ↗)
    17comments
  4. I don't like passkeys(hawksley.dev ↗)
    discuss
  5. Jemalloc 5.4.0(github.com/jemalloc ↗)
    54comments
  6. Microsoft exec called AI scraping 'the largest theft of labor in human history'(techcrunch.com ↗)
    230comments
  7. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  8. The scourge of x86 emulation(fex-emu.com ↗)
    37comments
  9. Astra for Law(openai.com ↗)
    604comments
  10. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    145comments
  11. Replacing Pull Requests with Delta(zed.dev ↗)
    18comments
  12. Subnormal floating-point numbers are expensive on Intel processors(lemire.me ↗)
    3comments
  13. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    238comments
  14. Qwen 3.8 Omni Flash(qwen.ai ↗)
    90comments
  15. Warren Buffett Steps Down as Berkshire Chairman, Names Son to Replace Him(nytimes.com ↗)
    19comments
  16. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    173comments
  17. Wax motor(wikipedia.org ↗)
    76comments
  18. When the fractional part of a float fixes your shader(crocidb.com ↗)
    8comments
  19. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    236comments
  20. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    44comments
  21. Dr Julius Neubronner's Miniature Pigeon Camera(publicdomainreview.org ↗)
    discuss
  22. How to Write with an LLM(sockpuppet.org ↗)
    132comments
  23. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    161comments
  24. Shapelearn Qwen 3.8 27B (13.1 GB VRAM)(byteshape.com ↗)
    17comments
  25. Ask A Monk – A digital wilderness for thoughts with no immediate answer(askamonk.online ↗)
    27comments
  26. Flet 1.0 – Build cross-platform apps in Python(flet.dev ↗)
    69comments
  27. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    29comments
  28. Diplodocus, Long Thought Exclusively American, Turns Up in Spain(sci.news ↗)
    45comments
  29. Speeding up gearhash on ARM64(sam.dev ↗)
    discuss
  30. Why I didn’t sign the Fields medallists’ letter(gowers.wordpress.com ↗)
    376comments

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