HTTP routing on Heroku is made up of three main logical layers:
This last part is the one the platform team is happy to open-source today with the Vegur library.
Vegur can be thought of a bit like an nginx reverse-proxy, except its entire list of hosts and configuration is fully programmable, making it easy to hardcode, use files, use databases, or push state updates directly into the proxy and router states, while also allowing the same dynamism for features such as routing algorithms, choice of debugging headers, and so on.
This turned out to be a critical feature that few or none of the existing proxying mechanisms could support at a scale the size of Heroku. Vegur has been written in such a way that any compatible router could use it for its proxying job without compromising on the routing logic itself, making it easier to focus on higher level tasks.
It allows the following parts, to name a few, to be delegated to an Erlang code base:
Everything is documented in the README of the project with example code, samples, and examples.
Vegur has been used in production for over a year on the Heroku platform, and is also currently used to power the router in Heroku Private Spaces.
We hope this makes it easier for the community at large to develop interesting routing products, and enriches the ecosystem as a whole.