Simplified clone of the stupid-proxy (https://github.com/gpjt/stupid-proxy)