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:
System.properties << [ 'http.proxyHost':'proxyHost', 'http.proxyPort':'port' ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With