summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Ichikawa <gimite@gmail.com>2011-04-30 18:41:01 -0700
committerHiroshi Ichikawa <gimite@gmail.com>2011-04-30 18:41:01 -0700
commit4ddca99105555ab6b4ed41548eeca1a28a2f4f16 (patch)
treeb2444d190e62f1b9b0c7de31974ed471dd41aebf
parent93034d8baa85ebf01915dd71d9a3c7ebeb36bee4 (diff)
parent0e76f927c0f576e1068b58afe6026d6faf6fcaf1 (diff)
downloadweb-socket-js-4ddca99105555ab6b4ed41548eeca1a28a2f4f16.tar.gz
Merge pull request #69 from luciferous/master.
Default to port 443 when scheme is wss
-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();