I want to use a Groovy script to access a webpage. However I’m behind a proxy.
Here’s a test script that fails…
println "Google page is..."
println 'http://www.google.com'.toURL().text
Here’s the output…
>groovy proxytester.groovy
Google page is...
Caught: java.net.ConnectException: Connection timed out: connect
at checker.run(proxytester.groovy:2)
How do I set proxy server information in Groovy?
Or, from inside Groovy itself: