protected DefaultHttpClientConnection connectTo(HttpHost target,
HttpParams params)
throws Exception {
Scheme schm = supportedSchemes.get(target.getSchemeName());
int port = schm.resolvePort(target.getPort());
DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
Socket sock = schm.getSocketFactory().connectSocket
(null, target.getHostName(), port, null, 0, params);
conn.bind(sock, params);