Run the MockServer directly providing the parseArguments for the server and httpProxyBuilder as the only input parameters (if not provided the server port defaults to 8080 and the httpProxyBuilder is not started).
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)