org.mockserver.proxy.http
Class HttpProxyBuilder

java.lang.Object
  extended by org.mockserver.proxy.http.HttpProxyBuilder

public class HttpProxyBuilder
extends Object

This class should be used to configure the HttpProxy, using this class is the simplest way to create an HttpProxy instance

Author:
jamesdbloom

Constructor Summary
HttpProxyBuilder()
           
 
Method Summary
 HttpProxy build()
          Build an instance of the HttpProxy
 Thread buildAndReturnThread()
          Build an instance of the HttpProxy
 HttpProxyBuilder withDirect(Integer fromPort, String toHost, Integer toPort)
          Configure a direct proxy that forwards all requests on the fromPort to the toHost and toPort
 HttpProxyBuilder withDirectSSL(Integer fromSecurePort, String toHost, Integer toPort)
          Configure a secure direct proxy that forwards all requests on the fromSecurePort to the toHost and toPort using SSL
 HttpProxyBuilder withHTTPPort(Integer port)
          Configure HTTP port for proxy, setting this value will ensure HTTP is supported
 HttpProxyBuilder withHTTPSPort(Integer securePort)
          Configure HTTP/SSL (HTTPS) port for proxy, setting this value will ensure HTTPS is supported, clients that use HTTP -> HTTPS CONNECT request also require the HTTP port to be set using HttpProxyBuilder#withHTTPPort(Integer port)
 HttpProxyBuilder withSOCKSPort(Integer socksPort)
          Configure SOCKS port for proxy, setting this value will ensure SOCKS is supported Note: currently clients using SSL after connecting with SOCKS are not current supported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpProxyBuilder

public HttpProxyBuilder()
Method Detail

withHTTPPort

public HttpProxyBuilder withHTTPPort(Integer port)
Configure HTTP port for proxy, setting this value will ensure HTTP is supported

Parameters:
port - the HTTP port to use

withHTTPSPort

public HttpProxyBuilder withHTTPSPort(Integer securePort)
Configure HTTP/SSL (HTTPS) port for proxy, setting this value will ensure HTTPS is supported, clients that use HTTP -> HTTPS CONNECT request also require the HTTP port to be set using HttpProxyBuilder#withHTTPPort(Integer port)

Parameters:
securePort - the HTTP/SSL (HTTPS) port to use

withSOCKSPort

public HttpProxyBuilder withSOCKSPort(Integer socksPort)
Configure SOCKS port for proxy, setting this value will ensure SOCKS is supported Note: currently clients using SSL after connecting with SOCKS are not current supported

Parameters:
socksPort - the SOCKS port to use

withDirect

public HttpProxyBuilder withDirect(Integer fromPort,
                                   String toHost,
                                   Integer toPort)
Configure a direct proxy that forwards all requests on the fromPort to the toHost and toPort

Parameters:
fromPort - the local proxy port for direct forwarding
toHost - the destination hostname for direct forwarding
toPort - the destination port for direct forwarding

withDirectSSL

public HttpProxyBuilder withDirectSSL(Integer fromSecurePort,
                                      String toHost,
                                      Integer toPort)
Configure a secure direct proxy that forwards all requests on the fromSecurePort to the toHost and toPort using SSL

Parameters:
fromSecurePort - the local proxy port for direct forwarding over SSL
toHost - the destination hostname for direct forwarding
toPort - the destination port for direct forwarding

build

public HttpProxy build()
Build an instance of the HttpProxy


buildAndReturnThread

public Thread buildAndReturnThread()
Build an instance of the HttpProxy



Copyright © 2014. All rights reserved.