]> andersk Git - moira.git/commitdiff
If we're an applet, try to connect to port 443 on the host we were
authorzacheiss <zacheiss>
Tue, 12 Jul 2005 16:15:49 +0000 (16:15 +0000)
committerzacheiss <zacheiss>
Tue, 12 Jul 2005 16:15:49 +0000 (16:15 +0000)
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.

clients/regapplet/regapplet/Worker.java

index 0caea1635b4b7686d9ab0d12b8b642afcc828217..8e7504edb5a49e2cf91e5f88b0db9b9b44cf4b94 100644 (file)
@@ -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);
This page took 1.82101 seconds and 5 git commands to generate.