summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--WebSocketMain.swfbin175746 -> 175753 bytes
-rw-r--r--WebSocketMainInsecure.zipbin166589 -> 166462 bytes
-rw-r--r--flash-src/WebSocket.as6
3 files changed, 4 insertions, 2 deletions
diff --git a/WebSocketMain.swf b/WebSocketMain.swf
index 7561215..0fb5449 100644
--- a/WebSocketMain.swf
+++ b/WebSocketMain.swf
Binary files differ
diff --git a/WebSocketMainInsecure.zip b/WebSocketMainInsecure.zip
index c02a249..691f84c 100644
--- a/WebSocketMainInsecure.zip
+++ b/WebSocketMainInsecure.zip
Binary files differ
diff --git a/flash-src/WebSocket.as b/flash-src/WebSocket.as
index 04d7f05..0cbbe8b 100644
--- a/flash-src/WebSocket.as
+++ b/flash-src/WebSocket.as
@@ -65,7 +65,8 @@ public class WebSocket extends EventDispatcher {
if (!m) fatal("SYNTAX_ERR: invalid url: " + url);
this.scheme = m[1];
this.host = m[2];
- this.port = parseInt(m[4] || "80");
+ var defaultPort:int = scheme == "wss" ? 443 : 80;
+ this.port = parseInt(m[4]) || defaultPort;
this.path = (m[5] || "/") + (m[6] || "");
this.origin = origin;
this.protocol = protocol;
@@ -161,7 +162,8 @@ public class WebSocket extends EventDispatcher {
tlsSocket.startTLS(rawSocket, host, tlsConfig);
}
- var hostValue:String = host + (port == 80 ? "" : ":" + port);
+ var defaultPort:int = scheme == "wss" ? 443 : 80;
+ var hostValue:String = host + (port == defaultPort ? "" : ":" + port);
var key1:String = generateKey();
var key2:String = generateKey();
var key3:String = generateKey3();