excon/excon — pull request #427 by brandur (2014-09-13 00:23:57+00:00)
Title: Add support for proxies running on a Unix domain socket

I really like that Excon supports HTTP connections via a Unix domain socket, and the purpose of this pull is to extend this functionality to support proxies running over Unix domain sockets as well.

The current syntax for connecting to a Unix socket looks like this:

``` ruby
connection = Excon.new('unix:///', :socket => '/tmp/unicorn.sock')
```

I've tried to stay true to this by mirroring this in the proxy settings:

``` ruby
connection = Excon.new('unix:///', :socket => '/tmp/unicorn.sock',
:proxy => 'unix:///', :proxy_socket => '/tmp/proxy.sock')
```

As with current proxy settings, these can be overwritten by config vars as well:

``` bash
HTTP_PROXY=unix:/// HTTP_PROXY_SOCKET=/tmp/proxy.sock ./myapp
```

I think the biggest problem with this technique is that things get a little fuzzy once SSL proxies are combined with the Unix settings (i.e. no SSL Unix socket is possible, although a Unix socket proxy can proxy an SSL connection with no trouble). I think this is mostly okay because:

* Connections to a Unix domain socket via SSL are already not really supported as far as I can tell (`UnixSocket` and `SSLSocket` are different classes) and don't compose.
* I don't think there's a huge use case for securing communication within the computer with SSL.

@geemus I mostly want to gauge your impressions on whether this is a reasonable idea. If so, I'll try to clean-up the code where I can and add an appropriate test suite. Thanks!