Skip to content

Instantly share code, notes, and snippets.

@michalbcz
michalbcz / gist:4167914
Created November 29, 2012 09:58
groovy - connect to URL through proxy
import java.net.*;
import java.io.*;
/* PROXY SETTINGS */
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "some.proxyserver.com");
System.getProperties().put("proxyPort", "8080");
Authenticator.setDefault(new MyAuthenticator());