fix default port detection
This commit is contained in:
@@ -103,7 +103,7 @@ public class Socket extends Emitter {
|
||||
private boolean timestampRequests;
|
||||
private boolean upgrading;
|
||||
private boolean rememberUpgrade;
|
||||
private int port;
|
||||
/*package*/ int port;
|
||||
private int policyPort;
|
||||
private int prevBufferLen;
|
||||
private long pingInterval;
|
||||
@@ -176,6 +176,9 @@ public class Socket extends Emitter {
|
||||
}
|
||||
if (pieces.length > 1) {
|
||||
opts.port = Integer.parseInt(pieces[pieces.length - 1]);
|
||||
} else if (opts.port == -1) {
|
||||
// if no port is specified manually, use the protocol default
|
||||
opts.port = this.secure ? 443 : 80;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -808,6 +811,8 @@ public class Socket extends Emitter {
|
||||
filteredUpgrades.add(upgrade);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return filteredUpgrades;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,8 +140,8 @@ public abstract class Transport extends Emitter {
|
||||
public String timestampParam;
|
||||
public boolean secure;
|
||||
public boolean timestampRequests;
|
||||
public int port;
|
||||
public int policyPort;
|
||||
public int port = -1;
|
||||
public int policyPort = -1;
|
||||
public Map<String, String> query;
|
||||
public SSLContext sslContext;
|
||||
protected Socket socket;
|
||||
|
||||
Reference in New Issue
Block a user