0
votes

I have a server remote console webstart application - jnlp file which needs to connect via a SOCKS proxy. The challenge I have is that I do not want to change the IE proxy or common Java network settings to use the jnlp file as it's 1) tedious to change it every time, 2) interferes with other java applications parallelly running connecting to intranet/internet

I would like to know if its possible to set the proxy like below. This will help me to run the jnlp file using a batch file and the proxy settings will be confined to this instance of the jvm.

javaws -JsocksProxyHost=127.0.0.1 -JsocksProxyPort=8080 iLO-jirc.jnlp

javaws version - 11.151.2.12

Thank You

2
Anyone who has some similar ? - sshark
OpenWebStart (www.openwebstart.com) supports SOCKS proxy. Maybe you give it a try. - Hendrik Ebbers

2 Answers

0
votes

The way to do it is javaws -J-DsocksProxyHost=127.0.0.1 -J-DsocksProxyPort=8080 iLO-jirc.jnlp.

Or configuring the required socks proxy with javaws -viewer

Neither work for me with the java Dell iDrac (similar to your case), I had to use proxychains for make it works. Like this

  1. javaws viewer.jnlp launch with no config (will not work)
  2. Get the full generated command with ps aux | grep java
  3. You will get something like this
    /usr/lib/jvm/java-8-jdk/jre/bin/java -classpath /usr/lib/jvm/java-8-jdk/jre/lib/deploy.jar -Djava.security.policy=file:/usr/lib/jvm/java-8-jdk/jre/lib/security/javaws.policy -DtrustProxy=true -Xverify:remote -Djnlpx.home=/usr/lib/jvm/java-8-jdk/jre/bin -Djava.security.manager -Djnlpx.origFilenameArg=viewer.jnlp -Djnlpx.remove=false -Dsun.awt.warmup=true -Xbootclasspath/a:/usr/lib/jvm/java-8-jdk/jre/lib/javaws.jar:/usr/lib/jvm/java-8-jdk/jre/lib/deploy.jar:/usr/lib/jvm/java-8-jdk/jre/lib/plugin.jar -Djnlpx.splashport=46417 -Djnlpx.jvm=/usr/lib/jvm/java-8-jdk/jre/bin/java com.sun.javaws.Main viewer.jnlp
    
  4. Install and configure proxychains
  5. Then just add proxychains in front of it
  6. proxychains /usr/lib/jvm/java-8-jdk/jre/bin/java -classpath /usr/lib/jvm/java-8-jdk/jre/lib/deploy.jar -Djava.security.policy=file:/usr/lib/jvm/java-8-jdk/jre/lib/security/javaws.policy -DtrustProxy=true -Xverify:remote -Djnlpx.home=/usr/lib/jvm/java-8-jdk/jre/bin -Djava.security.manager -Djnlpx.origFilenameArg=viewer.jnlp -Djnlpx.remove=false -Dsun.awt.warmup=true -Xbootclasspath/a:/usr/lib/jvm/java-8-jdk/jre/lib/javaws.jar:/usr/lib/jvm/java-8-jdk/jre/lib/deploy.jar:/usr/lib/jvm/java-8-jdk/jre/lib/plugin.jar -Djnlpx.splashport=46417 -Djnlpx.jvm=/usr/lib/jvm/java-8-jdk/jre/bin/java com.sun.javaws.Main viewer.jnlp
    

You might need to re-download viewer.jnlp twice because the token inside expire fastly.

Some other observations

Sometimes the generated command by javaws have a weird option like -Djnlpx.vmargs=LURzb2Nrc1Byb3h5SG9zdD1sb2NhbGhvc3QALURzb2Nrc1Byb3h5UG9ydD05MDUxAA== It's base64 encoded params for some weird inception jnlpx stuff give -DsocksProxyHost=localhost-DsocksProxyPort=9051

0
votes

As Hugo said you can configure socks proxy with javaws -viewer

Insert your proxy server and port at:

General>Network Settings>Use proxy server>Advanced>Socks