Added support for HTTP proxy. This was tested on iOS. It should also work on OSX.