Fix a number of issues with proxies and add unit tests for all proxy options / configurations