Q:

URL(url).openStream() with Proxy

is it possible to add a Proxy to my URL().openStream()?          
scanner = new Scanner(new URL(url).openStream());

my Proxy has user and password

A:

maybe you can start with this:
String proxyUser = "";
String proxyPassword = "";
String proxyAddress = "";
int proxyPort = 8080;
InetSocketAddress sa = new InetSocketAddress(proxyAddress, proxyPort);
Proxy proxy = new Proxy(Proxy.Type.HTTP, sa);
URLConnection conn = url.openConnection(proxy);
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
String encodedUserPwd = encoder.encode((proxyUser + ":" + proxyPassword).getBytes());
conn.setRequestProperty("Accept-Charset", "UTF-8");
conn.setRequestProperty("Proxy-Authorization", "Basic " + encodedUserPwd);

