Proxy support - rebased

This is a rebased pull request to master that adds proxy support without changes from other branches