Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX url-proxy?

My computer is running behind proxy. I want to access url from JavaFX. for example say i want to show image from a url. But i haven't seen anyway to provide proxy settings for the connection(?). Please if someone can tell me how to do things in such situation? Thanks

like image 928
RubyDubee Avatar asked Apr 26 '26 20:04

RubyDubee


2 Answers

As link in accepted answer doesn't work anymore I'm adding proxy setting code here:

    System.setProperty("http.proxyHost", "myproxyhost");
    System.setProperty("http.proxyPort", "80");
like image 77
Sergey Grinev Avatar answered Apr 29 '26 10:04

Sergey Grinev


By default, JavaFX will automatically use your Operating Systems proxy settings, this is controlled via the Java Preferences or Java Control panel icons on your Mac or PC.

You can also set, within Java, the proxy environment variables, but I haven't tried this.

If you are trying to request an external resource from an unsigned application, Java may prompt you (the user) for permission when it runs.

like image 33
Steven Herod Avatar answered Apr 29 '26 09:04

Steven Herod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!