The Coolest Piece of Code

Written by on Feb 3 2016

The coolest thing I’ve ever written was a proxy server for Voice Over IP communications.

In 2000 I was working in the Silicon Valley for a Voice Over IP company called HearMe. For a time, before the bubble of 2001, we had the best VOIP software in the world. I was asked to write a proxy server so our software phone could go through corporate firewalls. The VOIP traffic runs on a few ports over UDP. Many customers did not want to open those UDP ports in their firewalls. So I was tasked with writing a proxy server to allow that voice traffic to go through firewalls. All the connections to the clients were over TCP port 443 (which every firewall leaves open for normal, secured web browsing). A friend at HearMe had written the software phone so we worked together to make a custom socket protocol that would wrap all the VoIP traffic. The proxy server would translate the TCP messages into UDP messages and send them to our Voice Servers.

The tricky part was performance and scalability. With VoIP traffic even a little latency can cause jitter in the audio, which reduces call quality and makes it hard to understand the other person. To make it as fast as possible I wrote it in C++ running on Linux. Next was a multi-threaded system to allow multiple calls to run in isolation. After the initial debugging and some perfomance tuning the thing ran fast and scaled big. It became known affectionately as “The Bristol Box.” I was told that in customer meetings whenever the subject of firewalls came up the customers were told “We’ll just use the Bristol Box.”

I’d love to hear about the coolest piece of code you’ve ever written, leave a comment or send me an email!

Meet
Steven

Hi I'm Steven,

I wrote the article you're reading... I lead the developers, write music, used to race motorcycles, and help clients find the right features to build on their product.

Get Blog Updates