Add proxyHost and proxyPort java applet params.

pull/1/head
runge 16 years ago
parent ac33a29f07
commit b6ee5f9619

@ -184,9 +184,24 @@ Both TightVNC and UltraVNC Java viewers:
safely put oneTimeKey=... on the URL. The Vncviewer safely put oneTimeKey=... on the URL. The Vncviewer
authenticates the VNC server with this key. authenticates the VNC server with this key.
proxyHost
string, default: none
Do not try to guess the proxy's hostname, use the value in
proxyHost. Does not imply forceProxy (below.)
proxyPort
string, default: none
Do not try to guess the proxy's port number, use the value in
proxyPort. Does not imply forceProxy (below.)
forceProxy forceProxy
yes/no, default: no yes/no, default: no
Assume there is a proxy. Assume there is a proxy and force its use.
If a string other than "yes" or "no" is given, it implies "yes"
and uses the string for proxyHost and proxyPort (see above).
In this case the string must be of the form "hostname+port".
Note that it is "+" and not ":" before the port number.
ignoreProxy ignoreProxy
yes/no, default: no yes/no, default: no

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -73,8 +73,8 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0'); serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0');
diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSLSocketToMe.java diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSLSocketToMe.java
--- vnc_javasrc.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500 --- vnc_javasrc.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500
+++ vnc_javasrc/SSLSocketToMe.java 2009-06-18 09:47:22.000000000 -0400 +++ vnc_javasrc/SSLSocketToMe.java 2009-06-19 10:23:50.000000000 -0400
@@ -0,0 +1,1717 @@ @@ -0,0 +1,1726 @@
+/* +/*
+ * SSLSocketToMe.java: add SSL encryption to Java VNC Viewer. + * SSLSocketToMe.java: add SSL encryption to Java VNC Viewer.
+ * + *
@ -924,7 +924,16 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL
+ } catch (Exception e) { + } catch (Exception e) {
+ dbg("props failed: " + e.getMessage()); + dbg("props failed: " + e.getMessage());
+ } + }
+ if (props != null) { + if (viewer.proxyHost != null) {
+ dbg("Using supplied proxy " + viewer.proxyHost + " " + viewer.proxyPort + " applet parameters.");
+ proxyHost = viewer.proxyHost;
+ if (viewer.proxyPort != null) {
+ proxyPort = gint(viewer.proxyPort);
+ } else {
+ proxyPort = 8080;
+ }
+
+ } else if (props != null) {
+ dbg("\n---------------\nAll props:"); + dbg("\n---------------\nAll props:");
+ props.list(System.out); + props.list(System.out);
+ dbg("\n---------------\n\n"); + dbg("\n---------------\n\n");
@ -1794,7 +1803,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL
+} +}
diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncViewer.java diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncViewer.java
--- vnc_javasrc.orig/VncViewer.java 2004-03-04 08:34:25.000000000 -0500 --- vnc_javasrc.orig/VncViewer.java 2004-03-04 08:34:25.000000000 -0500
+++ vnc_javasrc/VncViewer.java 2007-09-03 23:22:13.000000000 -0400 +++ vnc_javasrc/VncViewer.java 2009-06-19 10:32:03.000000000 -0400
@@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
// Variables read from parameter values. // Variables read from parameter values.
String socketFactory; String socketFactory;
@ -1804,7 +1813,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
boolean showControls; boolean showControls;
boolean offerRelogin; boolean offerRelogin;
boolean showOfflineDesktop; boolean showOfflineDesktop;
@@ -88,6 +88,17 @@ @@ -88,6 +88,19 @@
int deferCursorUpdates; int deferCursorUpdates;
int deferUpdateRequests; int deferUpdateRequests;
@ -1814,6 +1823,8 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
+ String urlPrefix; + String urlPrefix;
+ String httpsPort; + String httpsPort;
+ String oneTimeKey; + String oneTimeKey;
+ String proxyHost;
+ String proxyPort;
+ boolean forceProxy; + boolean forceProxy;
+ boolean ignoreProxy; + boolean ignoreProxy;
+ boolean trustAllVncCerts; + boolean trustAllVncCerts;
@ -1822,7 +1833,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
// Reference to this applet for inter-applet communication. // Reference to this applet for inter-applet communication.
public static java.applet.Applet refApplet; public static java.applet.Applet refApplet;
@@ -591,8 +602,25 @@ @@ -591,8 +604,25 @@
} }
} }
@ -1850,7 +1861,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
if (inAnApplet) { if (inAnApplet) {
str = readParameter("Open New Window", false); str = readParameter("Open New Window", false);
@@ -626,6 +654,68 @@ @@ -626,6 +656,96 @@
// SocketFactory. // SocketFactory.
socketFactory = readParameter("SocketFactory", false); socketFactory = readParameter("SocketFactory", false);
@ -1897,15 +1908,43 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
+ } + }
+ +
+ forceProxy = false; + forceProxy = false;
+ proxyHost = null;
+ proxyPort = null;
+ str = readParameter("forceProxy", false); + str = readParameter("forceProxy", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null) {
+ forceProxy = true; + if (str.equalsIgnoreCase("Yes")) {
+ forceProxy = true;
+ } else if (str.equalsIgnoreCase("No")) {
+ forceProxy = false;
+ } else {
+ forceProxy = true;
+ String[] pieces = str.split(" ");
+ proxyHost = new String(pieces[0]);
+ if (pieces.length >= 2) {
+ proxyPort = new String(pieces[1]);
+ } else {
+ proxyPort = new String("8080");
+ }
+ }
+ } + }
+ str = readParameter("proxyHost", false);
+ if (str != null) {
+ proxyHost = new String(str);
+ }
+ str = readParameter("proxyPort", false);
+ if (str != null) {
+ proxyPort = new String(str);
+ }
+ if (proxyHost != null && proxyPort == null) {
+ proxyPort = new String("8080");
+ }
+
+ ignoreProxy = false; + ignoreProxy = false;
+ str = readParameter("ignoreProxy", false); + str = readParameter("ignoreProxy", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {
+ ignoreProxy = true; + ignoreProxy = true;
+ } + }
+
+ trustAllVncCerts = false; + trustAllVncCerts = false;
+ str = readParameter("trustAllVncCerts", false); + str = readParameter("trustAllVncCerts", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {

@ -2644,8 +2644,8 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
// } // }
diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java
--- JavaViewer.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500 --- JavaViewer.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500
+++ JavaViewer/SSLSocketToMe.java 2009-06-18 09:47:22.000000000 -0400 +++ JavaViewer/SSLSocketToMe.java 2009-06-19 10:23:50.000000000 -0400
@@ -0,0 +1,1717 @@ @@ -0,0 +1,1726 @@
+/* +/*
+ * SSLSocketToMe.java: add SSL encryption to Java VNC Viewer. + * SSLSocketToMe.java: add SSL encryption to Java VNC Viewer.
+ * + *
@ -3495,7 +3495,16 @@ diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java
+ } catch (Exception e) { + } catch (Exception e) {
+ dbg("props failed: " + e.getMessage()); + dbg("props failed: " + e.getMessage());
+ } + }
+ if (props != null) { + if (viewer.proxyHost != null) {
+ dbg("Using supplied proxy " + viewer.proxyHost + " " + viewer.proxyPort + " applet parameters.");
+ proxyHost = viewer.proxyHost;
+ if (viewer.proxyPort != null) {
+ proxyPort = gint(viewer.proxyPort);
+ } else {
+ proxyPort = 8080;
+ }
+
+ } else if (props != null) {
+ dbg("\n---------------\nAll props:"); + dbg("\n---------------\nAll props:");
+ props.list(System.out); + props.list(System.out);
+ dbg("\n---------------\n\n"); + dbg("\n---------------\n\n");
@ -4488,7 +4497,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
result = 0; // Transparent pixel result = 0; // Transparent pixel
diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
--- JavaViewer.orig/VncViewer.java 2006-05-24 15:14:40.000000000 -0400 --- JavaViewer.orig/VncViewer.java 2006-05-24 15:14:40.000000000 -0400
+++ JavaViewer/VncViewer.java 2009-01-11 12:28:55.000000000 -0500 +++ JavaViewer/VncViewer.java 2009-06-19 10:31:23.000000000 -0400
@@ -80,11 +80,11 @@ @@ -80,11 +80,11 @@
GridBagLayout gridbag; GridBagLayout gridbag;
ButtonPanel buttonPanel; ButtonPanel buttonPanel;
@ -4512,7 +4521,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
String passwordParam; String passwordParam;
String encPasswordParam; String encPasswordParam;
boolean showControls; boolean showControls;
@@ -115,28 +115,68 @@ @@ -115,28 +115,70 @@
int i; int i;
// mslogon support 2 end // mslogon support 2 end
@ -4524,6 +4533,8 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
+String httpsPort; +String httpsPort;
+String oneTimeKey; +String oneTimeKey;
+String ftpDropDown; +String ftpDropDown;
+String proxyHost;
+String proxyPort;
+boolean forceProxy; +boolean forceProxy;
+boolean ignoreProxy; +boolean ignoreProxy;
+boolean trustAllVncCerts; +boolean trustAllVncCerts;
@ -4587,7 +4598,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
// authenticator = new AuthPanel(false); // mslogon support : go to connectAndAuthenticate() // authenticator = new AuthPanel(false); // mslogon support : go to connectAndAuthenticate()
if (RecordingFrame.checkSecurity()) if (RecordingFrame.checkSecurity())
rec = new RecordingFrame(this); rec = new RecordingFrame(this);
@@ -147,10 +187,11 @@ @@ -147,10 +189,11 @@
cursorUpdatesDef = null; cursorUpdatesDef = null;
eightBitColorsDef = null; eightBitColorsDef = null;
@ -4601,7 +4612,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
rfbThread = new Thread(this); rfbThread = new Thread(this);
rfbThread.start(); rfbThread.start();
} }
@@ -186,6 +227,30 @@ @@ -186,6 +229,30 @@
gbc.weightx = 1.0; gbc.weightx = 1.0;
gbc.weighty = 1.0; gbc.weighty = 1.0;
@ -4632,7 +4643,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
// Add ScrollPanel to applet mode // Add ScrollPanel to applet mode
// Create a panel which itself is resizeable and can hold // Create a panel which itself is resizeable and can hold
@@ -286,6 +351,24 @@ @@ -286,6 +353,24 @@
void connectAndAuthenticate() throws Exception { void connectAndAuthenticate() throws Exception {
@ -4657,7 +4668,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
// If "ENCPASSWORD" parameter is set, decrypt the password into // If "ENCPASSWORD" parameter is set, decrypt the password into
// the passwordParam string. // the passwordParam string.
@@ -336,7 +419,22 @@ @@ -336,7 +421,22 @@
// //
@ -4681,7 +4692,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
authenticator = new AuthPanel(mslogon); authenticator = new AuthPanel(mslogon);
@@ -390,6 +488,10 @@ @@ -390,6 +490,10 @@
break; break;
//mslogon support end //mslogon support end
@ -4692,7 +4703,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
// Retry on authentication failure. // Retry on authentication failure.
authenticator.retry(); authenticator.retry();
} }
@@ -405,9 +507,11 @@ @@ -405,9 +509,11 @@
void prologueDetectAuthProtocol() throws Exception { void prologueDetectAuthProtocol() throws Exception {
@ -4706,7 +4717,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
System.out.println("RFB server supports protocol version " + System.out.println("RFB server supports protocol version " +
rfb.serverMajor + "." + rfb.serverMinor); rfb.serverMajor + "." + rfb.serverMinor);
@@ -431,16 +535,36 @@ @@ -431,16 +537,36 @@
boolean tryAuthenticate(String us, String pw) throws Exception { boolean tryAuthenticate(String us, String pw) throws Exception {
@ -4749,7 +4760,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
switch (authScheme) { switch (authScheme) {
@@ -629,6 +753,10 @@ @@ -629,6 +755,10 @@
void doProtocolInitialisation() throws IOException { void doProtocolInitialisation() throws IOException {
@ -4760,7 +4771,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
rfb.writeClientInit(); rfb.writeClientInit();
rfb.readServerInit(); rfb.readServerInit();
@@ -775,8 +903,25 @@ @@ -775,8 +905,25 @@
} }
} }
@ -4788,7 +4799,7 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
if (inAnApplet) { if (inAnApplet) {
str = readParameter("Open New Window", false); str = readParameter("Open New Window", false);
@@ -804,6 +949,105 @@ @@ -804,6 +951,133 @@
deferScreenUpdates = readIntParameter("Defer screen updates", 20); deferScreenUpdates = readIntParameter("Defer screen updates", 20);
deferCursorUpdates = readIntParameter("Defer cursor updates", 10); deferCursorUpdates = readIntParameter("Defer cursor updates", 10);
deferUpdateRequests = readIntParameter("Defer update requests", 50); deferUpdateRequests = readIntParameter("Defer update requests", 50);
@ -4846,15 +4857,43 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
+ } + }
+ +
+ forceProxy = false; + forceProxy = false;
+ proxyHost = null;
+ proxyPort = null;
+ str = readParameter("forceProxy", false); + str = readParameter("forceProxy", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null) {
+ forceProxy = true; + if (str.equalsIgnoreCase("Yes")) {
+ forceProxy = true;
+ } else if (str.equalsIgnoreCase("No")) {
+ forceProxy = false;
+ } else {
+ forceProxy = true;
+ String[] pieces = str.split(" ");
+ proxyHost = new String(pieces[0]);
+ if (pieces.length >= 2) {
+ proxyPort = new String(pieces[1]);
+ } else {
+ proxyPort = new String("8080");
+ }
+ }
+ } + }
+ str = readParameter("proxyHost", false);
+ if (str != null) {
+ proxyHost = new String(str);
+ }
+ str = readParameter("proxyPort", false);
+ if (str != null) {
+ proxyPort = new String(str);
+ }
+ if (proxyHost != null && proxyPort == null) {
+ proxyPort = new String("8080");
+ }
+
+ ignoreProxy = false; + ignoreProxy = false;
+ str = readParameter("ignoreProxy", false); + str = readParameter("ignoreProxy", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {
+ ignoreProxy = true; + ignoreProxy = true;
+ } + }
+
+ trustAllVncCerts = false; + trustAllVncCerts = false;
+ str = readParameter("trustAllVncCerts", false); + str = readParameter("trustAllVncCerts", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {

@ -2,7 +2,7 @@
Copyright (C) 2002-2009 Karl J. Runge <runge@karlrunge.com> Copyright (C) 2002-2009 Karl J. Runge <runge@karlrunge.com>
All rights reserved. All rights reserved.
x11vnc README file Date: Thu Jun 18 21:59:34 EDT 2009 x11vnc README file Date: Fri Jun 19 10:41:53 EDT 2009
The following information is taken from these URLs: The following information is taken from these URLs:

Loading…
Cancel
Save