}
final Scheme scheme = schemeRegistry.getScheme(target.getSchemeName());
final SchemeSocketFactory sf = scheme.getSchemeSocketFactory();
final int port = scheme.resolvePort(target.getPort());
Socket sock = sf.createSocket(params);
conn.opening(sock, target);
InetSocketAddress remoteAddress = InetSocketAddress.createUnresolved(target.getHostName(), port);
InetSocketAddress localAddress = null;
if(local != null) {
localAddress = new InetSocketAddress(local, 0);