edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
713 stars 110 forks source link

proxy support #102

Open storkeu opened 6 years ago

storkeu commented 6 years ago

Hi,

How does fxlauncher handle behind proxy scenarios? When experimenting with demo, it failed to connect.

Feb 22, 2018 4:23:51 PM fxlauncher.Launcher lambda$start$0
WARNING: Error during File Synchronization phase java.net.ConnectException: Connection refused: connect

Can user specify proxy or read app proxy settings?

edvin commented 6 years ago

You can supply proxy parameters the normal way, .ie -Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800 :)

storkeu commented 6 years ago

Tks, I managed to start the demo with no errors with your tip (poor java experience...) But in my scenario I have a native app with bundled jre, and don't expect users to have java installed. In my app I have a form to allow user to specify proxy settings and detect if no internet connection. How can fxlauncher work with this scenario? fxlauncher runs first, right?

edvin commented 6 years ago

FXLauncher bundles the JRE, but there is currently no feature that will allow you to ask the user for proxy information, so update wouldn't work. This feature could be added to the launcher pretty easily though.

sahajamit commented 6 years ago

I also faced the similar issue but able to solve it using this library

I added the code in the Launcher.java to resolve the proxy for the app server url and added that proxy host and port as environment varaibles.

It started working by just double clicking the jar now but the size of the fxlauncher jar is increased from 37 kb to 6 MB. Still it is acceptable for me as my users are with in my corporate network across different locations and each user could have a different proxy PAC script. So I had no choice but to use this proxy-vole library.

I can share the code if anybody is interested.

slimarafa commented 4 years ago

Hello, can you share your code using proxy-vole please, thank you.