| TIL: You can make HTTP requests without curl using Bash /dev/TCP(mareksuppa.com) | |
| 501 points by mrshu 23 hours ago | 215 comments | |
tl;dr: Bash can open raw TCP sockets via `/dev/tcp/host/port`, letting you make basic HTTP requests with just `exec 3<>/dev/tcp/...` and `printf` — useful when you're stuck in a stripped-down container with no curl or wget. Caveats: it's not a real HTTP client (no TLS, redirects, chunked encoding, etc.), requires `Connection: close` to avoid hangs, is bash-only (not POSIX), and depends on bash being compiled with `--enable-net-redirections`. | |
HN Discussion:
| |