views:

61

answers:

1

Normally if I run the following the following command in the rhino shell,

mbp001:rhino1_7R2 user$ java -jar js.jar 
Rhino 1.7 release 2 2009 03 22
js> readUrl("http://www.google.com")

It will return the resultant html markups. However, if I runs it behind a firewall, it will throw an exception (because it is unable to reach the host)

How can I make the Rhino shell aware of the proxy? Is there any -D switch for this purpose?

+1  A: 

have you tried the standard java system properties "http.proxyHost" and "http.proxyPort"?

command line would be:

java -Dhttp.proxyHost=proxy.bigcorp.com -Dhttp.proxyPort=9000 -jar js.jar
Gareth Davis
Great! It just fixed my problem!
Anthony Kong
how is that for a wild stab in the dark :-)
Gareth Davis