/** * Instruct REST Assured to connect to a proxy on the specified host and port. * * @param host The hostname of the proxy to connect to (for example <code>127.0.0.1</code>) * @param port The port of the proxy to connect to (for example <code>8888</code>) */ public static void proxy(String host, int port) { proxy(host(host).withPort(port)); }
/** * Instruct REST Assured to connect to a proxy on the specified host on port <code>8888</code>. * * @param host The hostname of the proxy to connect to (for example <code>127.0.0.1</code>). Can also be a URI represented as a String. * @see #proxy(String, int) */ public static void proxy(String host) { if (UriValidator.isUri(host)) { try { proxy(new URI(host)); } catch (URISyntaxException e) { throw new RuntimeException("Internal error in REST Assured when constructing URI for Proxy.", e); } } else { proxy(host(host)); } }