# Class LoopbackHttpClientSocketFactory

java.lang.Object
org.apache.jmeter.protocol.http.util.LoopbackHttpClientSocketFactory

public class LoopbackHttpClientSocketFactory extends Object
Commons HttpClient protocol factory to generate Loopback HTTP sockets

## Constructor Summary

Constructors
Constructor
Description
`LoopbackHttpClientSocketFactory()`

## Method Summary

Modifier and Type
Method
Description
`Socket`
`createSocket(String host, int port)`
`Socket`
`createSocket(String host, int port, InetAddress clientHost, int clientPort)`
`Socket`
`createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params)`
`static void`
`setup()`
Convenience method to set up the necessary HttpClient protocol and URL handler.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LoopbackHttpClientSocketFactory

public LoopbackHttpClientSocketFactory()

## Method Details

### createSocket

public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException

Throws:
  `IOException`
  `UnknownHostException`

### createSocket

public Socket createSocket(String host, int port) throws IOException, UnknownHostException

Throws:
  `IOException`
  `UnknownHostException`

### createSocket

public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException

Throws:
  `IOException`
  `UnknownHostException`
  `ConnectTimeoutException`

### setup

public static void setup()
Convenience method to set up the necessary HttpClient protocol and URL handler. Only works for HttpClient, because it's not possible (or at least very difficult) to provide a different socket factory for the HttpURLConnection class.