Allow specifying a socket factory for connections.

This socket factory will be used for all non-proxy connections and HTTP proxy connections.
Merge pull request #329 from square/jw/socket-factory

Allow specifying a socket factory for connections.