Properly deal with SOCKS proxies

Fixes #10