added support for socks and http proxying