/** * Instruct REST Assured to connect to a proxy on the specified port on localhost with a specific scheme. * * @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>) * @param scheme The http scheme (http or https) */ public static void proxy(String host, int port, String scheme) { proxy(new ProxySpecification(host, port, scheme)); }
/** * Instruct REST Assured to connect to a proxy on the specified port on localhost. * * @param port The port of the proxy to connect to (for example <code>8888</code>) * @see #proxy(String, int) */ public static void proxy(int port) { proxy(ProxySpecification.port(port)); }
/** * Instruct REST Assured to connect to a proxy using a URI. * * @param uri The URI of the proxy */ public static void proxy(URI uri) { if (uri == null) { throw new IllegalArgumentException("Proxy URI cannot be null"); } proxy(new ProxySpecification(uri.getHost(), uri.getPort(), uri.getScheme())); }
/** * 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)); } }
/** * 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)); }