jwagenleitner/groovy-wslite — Issue #27: Proxy example documentation error and suggested addition.
Author: mcrocker
Created: 2011-11-02 18:19:51+00:00
State: open

The home page examples have a minor problem with the proxy explanation.

First, there should be another closing parenthesis on the proxy line:

def proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress('proxy.example.com', 8080)

Should be:

def proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress('proxy.example.com', 8080))

In addition, this will not work if the proxy requires authentication, which is very poorly documented for the Java platform in general, so it would probably be a good idea to add the following:

Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new
PasswordAuthentication("username","password".toCharArray());
}})