0

I use a VPN client to access a website. My browers, like chrome, IE and firefox can all access the website. But java code, wget, curl cannot. Is there any setting for java to activate the function?

My VPN client is Jonus Pluse.

2 Answers 2

1
Try run your java application with :
java -Dhttp.proxyHost=webcache.example.com -Dhttp.proxyPort=8080;

Or set proxy before you get access to the network using HTTP:

System.setProperty("http.proxyHost", "webcache.example.com");
System.setProperty("http.proxyPort", "8080");

From: Java Networking and Proxies

Sign up to request clarification or add additional context in comments.

2 Comments

Hi, Jaskey. I did as you said. It shows "Connection timed out". For the proxy host is like "sslvpn.xxx.xxx.com", I guess I should use htttps.proxyHost https.proxyPort instead. But it is still show errors "Connection reset".
@慧储 ,this should be a problem beyond the scope of proxy, check the answer and comment at stackoverflow.com/questions/17170980/…
0

You can find the answer in the Java documentation.

Typically, you would use system properties:

java -Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800 ....

1 Comment

Thank you, lafarer. As I said to Jaskey, it shows errors "Connection timed out."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.