4

My computer is running behind proxy. I want to access url from JavaFX WebView. i used methods like System.setProperty() to set proxy for javafx.But it didnt work.Please help.

user1346220
  • 41
  • 1
  • 2

3 Answers3

1

According to the JavaFX deployment documentation.

3.2.3 Built-In Proxy Support

Properly packaged JavaFX application have proxy settings initialized according to Java Runtime configuration settings. By default, this means proxy settings will be taken from the current browser if the application is embedded into a web page, or system proxy settings will be used. Proxy settings are initialized by default in all execution modes.

Information on how to "properly package JavaFX applications" is in the deployment documentation previously referenced.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
0

You can use

System.setProperty("http.proxyHost","proxy.esrf.fr");
System.setProperty("http.proxyPort","3128");

As said in this answer.

Community
  • 1
  • 1
Benj
  • 1,184
  • 7
  • 26
  • 57
0

The key idea is that:

"proxy settings will be taken from the current browser if the application is embedded into a web page, or system proxy settings will be used"

So, if you need to use custom proxy settings (strings) using:

System.setProperty(
  "http.proxyHost",
  MY_PROXY_HOST);   

System.setProperty(
  "http.proxyPort",
  MY_PROXY_PORT);

in Netbeans you can disable setting proxy at application start to override it in code, by going to:

Project - Properties - Deployment - Disable proxy detection on application startup

.

Zon
  • 18,610
  • 7
  • 91
  • 99