fabric8io/fabric8 — pull request #1632 by danbev (2014-06-05 06:54:57+00:00)
Title: Fixes #1631 Adding a non binding ProtocolSocketFactory impl

Motivation:
The reason for this ProtocolSocketFactory implementation is
that for ProxyServlet we don't need to bind to a local address and port.
This binding can cause issue in PaaS environments where restrictions apply.

When HttpConnection's open method calls ProtocolSocketFactory's
createSocket(String, int, InetAddress, int, HttpConnectionParams)
which by default will use DefaultProtocolSocketFactory's
createSocket(String, int, InetAddress, int, HttpConnectionParams).
The method that will be invoked will be DefaultProtocolSocketFactory's
createSocket(String, int, InetAddress, int)
which will call
return new Socket(host, port, localAddress, localPort);
The above constructor will create a new Socket and connect to the
remote address and port (the first two arguments). It will also
bind() to the local address and port. This is the part that can
cause issue in PaaS environment where there are restrictions.

Modifications:
Provide a NonBindingSocketFactory that ignores the local address and
port avoiding binding to a local address.

Result:
The ProxyServlet is usable in PaaS environments without additional
configuration required by users.