// This ensures tha HttpClient knows about the protocol
Protocol.registerProtocol(LOOPBACK, new Protocol(LOOPBACK,new LoopbackHttpClientSocketFactory(),1));
// Now allow the URL handling to work.
URLStreamHandlerFactory ushf = new URLStreamHandlerFactory(){
public URLStreamHandler createURLStreamHandler(String protocol) {
if (protocol.equalsIgnoreCase(LOOPBACK)){
return new URLStreamHandler(){
protected URLConnection openConnection(URL u) throws IOException {
return null;// not needed for HttpClient