Hacker News new | past | comments | ask | show | jobs | submit login
HttpStat: It's like curl -v, with colours (github.com/davecheney)
96 points by guessmyname on Sept 24, 2016 | hide | past | favorite | 21 comments



> httpstat.py is a wrapper around curl(1), which is all fine and good, but what if you don't have curl(1) or python(1) installed?

So, the point of this is if you don't have either curl or python, but you do have golang. I can't imagine when that would happen. Is it intended for use inside a container?


Golang compiler produces static binary files, so you don't need install anything. Just run the binary.


But this seems like a developer tool -- what developer doesn't have Python and Curl installed...


People on Windows


If you develop web apps on windows you'll have Pyton installed.

Also windows has power shell which has its own curl equivalent.


the curl you get on powershell is absolutely not the same. The output of curl -v is totally different.

And no, even if you develop web apps you don't necessarily have Python installed. If I wrote node, or C#, or Go, or PHP exclusively, why would I bother with Python ? Sure there are some useful tools in Python, but it's absolutely not a given that you'll have it. Unlike on Linux, where Python is installed by default everywhere and you can basically assume Python is available.


Think of all the mess with python2 and python3 co-existence.


Where to install the binary from? Installation procedure is using "go get".


In theory, somebody could publish a binary that could be downloaded and run standalone -- no need for "go get". Looks like no such binary has been published, though.


Looks pretty shoddy from an IPv4/IPv6 point of view. It uses fmt.Sprintf("%s:%s") instead of net.JoinHostPort, and net.ResolveTCPAddr returns a single IP address instead of a properly-ordered list.

So it will probably fail to connect to an IPv6 literal, or to a dualstack hostname from an IPv6-only client.


Please don't use colored output if you didn't first check the background color of the terminal. If you can't check the background color of the terminal, then don't use colored output.


Did you checked the code? Because it does exactly what you describe already.


Thanks for posting this; I live in macOS Terminal.app, which pretends to be an xterm-256colors, and also displays lots of Unicode characters ok.

Amazed that we don't have better text-based UI, given these common capabilities in 2016.


Colored output reminds me of httpie: https://httpie.org/

The timings are a nice addition, although I am not sure if there is much use for it.


Uh ? the timings are the only thing httpstat does; it's not a client like httpie.


Sorry if I misunderstood the purpose. The title of this submission made it sound like this is supposed to be a replacement for `curl -v`.


Load testing tools such as Apache Bench or JMeter might be good at measuring performance. Personally I think a single sample might not be good enough.

Otherwise you can just grab data from various requests and feed them to R.


This isn't about load testing though. This is about getting some more useful information out of doing a request from a CLI, which can be a very handy way to see if there's an indication of a problem with an endpoint or a specific host.

It can be done with curl but then you also have to write a template for the output and pass it in to curl with -w to get things like timings.


Where's the JavaScript version? ;)


I'm waiting for a LOLCODE [0] version.

[0] http://lolcode.org/


Looks like a good supplement to httping




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: