if (target != null) {
try {
URI url = new URI("http://" + target.getHostString() + ":" + target.getPort());
LOG.info(String.format("Connecting '%s' to '%s:%d' using the http protocol",
socket.remoteAddress(), url.getHost(), url.getPort()));
ConnectionParameters params = new ConnectionParameters();
params.protocol = "http";
createClient(params, socket, url, received);
return;
} catch (URISyntaxException e) {
handleConnectFailure(socket, "Could not build valid connect URI: "+e);