kgpdemux is a TCP demultiplexer that uses the KGP protocol. I wrote it about a year ago as an experiment to use with Sauce Connect Proxy. It’s my best example of how to uses channels to implement complex control flows in Go efficiently. Sources are on Bitbucket:

The juicy part is kgp.go, where most of the concurrency is implemented.

That is all.