3 ms·
This is pretty neat if all you need is to ping a local server but please use curl (or something equivalent) for contacting remote services. HTTP1.1 seems like s
by AndrewStephens 4mo ago
This is pretty neat if all you need is to ping a local server but please use curl (or something equivalent) for contacting remote services. HTTP1.1 seems like such a simple protocol but in the real world you need to deal with proxies, different encodings, and redirects. Curl takes care of that (and a host of other annoying stuff) for you.
- mrshu 4mo agoTotally! I was really just trying to see if intra-container connectivity works, and this ended up being a very quick way of doing so. (The alternative being building and deploying a new image, which would likely take significantly longer.)
- KomoD 4mo ago> The alternative being building and deploying a new image, which would likely take significantly longer You said the image was Python, though? Using that is way easier and faster. https://news.ycombinator.com/item?id=48558763 https://news.ycombinator.com/item?id=48558763 If all you need to know is that it can connect: python3 -c 'import socket as s;s.create_connection(("8.8.8.8",53))' or http: python3 -c 'from urllib.request import*;print(urlopen("http://example.com").status http://example.com").status)'
- mrshu 4mo agoYou are right, I am not sure why I did not realize Python is the whole point of the image. This is indeed much faster and easier.
- EugeneV13 4mo ago[flagged]