From: zacheiss Date: Tue, 12 Jul 2005 16:15:49 +0000 (+0000) Subject: If we're an applet, try to connect to port 443 on the host we were X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/ef8f2d78ea394184eb35baec647c97fe6277a4e8 If we're an applet, try to connect to port 443 on the host we were downloaded from, since that's more likely to be allowed through if we're behind a firewall. If we're in standalone mode, keep using port 9001. --- diff --git a/clients/regapplet/regapplet/Worker.java b/clients/regapplet/regapplet/Worker.java index 0caea163..8e7504ed 100644 --- a/clients/regapplet/regapplet/Worker.java +++ b/clients/regapplet/regapplet/Worker.java @@ -75,7 +75,9 @@ public class Worker implements Runnable { applet.showMessage("Connecting to Server..."); try { String host; + int port; if (applet.isStandalone) { + port = 9001; host = (System.getProperties()).getProperty("host", ""); if (host == null || host.equals("")) { System.err.println("Cannot learn host name (application) using localhost"); @@ -84,6 +86,7 @@ public class Worker implements Runnable { } else { URL cb = applet.getCodeBase(); String protocol = cb.getProtocol(); + port = 443; // Use https port for firewall traversal. if (protocol.equals("file") || protocol.equals("FILE")) { System.err.println("Applet: FILE protocol in use, connecting to localhost"); host = "localhost"; @@ -91,7 +94,7 @@ public class Worker implements Runnable { host = cb.getHost(); } } - sock = new Socket(host, 9001); + sock = new Socket(host, port); } catch (Exception e) { e.printStackTrace(); applet.showError1(true);