TIL: You can make HTTP requests without curl using Bash /dev/TCP

TIL: You can make HTTP requests without curl using Bash /dev/TCP 图片 1

Edit: This has generated a nice discussion on Hacker News – check it out too!

I needed to check that one container could reach another over an internal Docker network: a plain GET /health against a service on a shared network. The obvious move is curl http://service:8642/health. But this app image was stripped right down, with no curl or wget and nothing else around that I could use to open a socket.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论