Category: Go
-
Taking an MQTT server out for a few holes on the code golf course
A while ago at work, I needed to learn a little about MQTT. After reading the spec and finding
-
Qz for Mobile Phones
I love Quartz. however, I find that the best time/place for me to read it is on the train during my commute. And Quartz’s overly clever and overly dynamic website hates my phone’s browser. So I made Mobile Quartz to help me read it. The front page has the current top articles from Quartz. Click…
-
Zero Downtime upgrades of TCP servers in Go
A recent post on the golang-nuts mailing list mentioned that Nginx can upgrade on the fly without ever stopping listening to it’s listen socket. The trick is to unset close-on-exec on the listen socket, then fork/exec a new copy of the server (on the upgraded binary) with an argument to tell it to use the…
-
Testing Go’s HTTP server for CVE-2011-3192 vulnerability
The recent DoS attack on Apache is caused by sending in a malformed Range header. I decided to send the same header into Go’s range header parser and see what happened. It passed with flying colors, giving the “invalid range” error, which would result in the Go webserver sending back HTTP response code 416 to…
-
A trip down the (split) rabbithole
Note: This post is out of date, and will become increasingly out of date when Go’s new contiguous stacks are implemented. I’m leaving it here because it is still interesting, even if out of date. Go uses split stacks (also called segmented stacks in the literature) in order to allow thousands of stacks in the…
-
How to control your HTTP transactions in Go
The Go http pacakge has http.Get and http.Post, which make it easy to do GET and POST operations. They are meant for client use. They implement things from the point of view of a naïve client, one that just wants to give a URL and get back the results. They don’t want to chase redirects,…
-
A rate-limiting HTTP proxy in Go
Hello Go-fans. Missed a week due to a nice little ski vacation, but I promise I was dreaming of Go while riding the ski lifts, so I’ve got something interesting to share with you this week. I’ve worked in Africa and Indonesia in the past. There, I saw first-hand the possibilities of the Internet, but…
-
Gobs on the wire
This week, I want to talk about how to use Go to write a client/server system with both synchronous requests and asynchronous event notifications. To help learn Go, I wrote a clone of the Conserver console server. Now, of course, the world didn’t need another console server, but it turned out to be an interesting…
-
The impatient producer
Last week I showed how a channel could link a producer and a consumer, and I idly speculated on how you’d set the depth of the queue, relative to the rate and variability of the producer and the consumer’s need for new input. This weekend, I got to thinking about my next interesting Go project.…
-
Using a channel as a queue
I try to write a Go article every Monday, but the holiday season has disrupted me a bit. So here’s a little something I dug out of my stocking to get things going again. I thought an interesting way to play with the exp/draw package, the http client, and the image decoder would be a…