Permalink
Browse files

Don't explicitly load the policy file, since flash will try port 843 …

…anyway. Furthermore, explicitly setting the port to 843 will make flash retry port 843 three times before trying the destination port. Instead we expose a method to the api loadPolicyFile that can be used to set the location of the policy file.
  • Loading branch information...
jvshahid committed Jan 8, 2011
1 parent 9807937 commit 0d8d903d8b3a2e0ce99a9e1198c82013936a7b30
Showing with 7 additions and 2 deletions.
  1. BIN WebSocketMain.swf
  2. BIN WebSocketMainInsecure.zip
  3. +1 −2 flash-src/WebSocketMain.as
  4. +6 −0 web_socket.js
View
Binary file not shown.
View
Binary file not shown.
@@ -50,7 +50,6 @@ public class WebSocketMain extends Sprite {
url:String, protocol:String,
proxyHost:String = null, proxyPort:int = 0,
headers:String = null):WebSocket {
- loadPolicyFile("xmlsocket://" + URLUtil.getServerName(url) + ":843");
return new WebSocket(this, url, protocol, proxyHost, proxyPort, headers);
}
@@ -65,7 +64,7 @@ public class WebSocketMain extends Sprite {
public function loadPolicyFile(url:String):void {
log("policy file: " + url);
- Security.loadPolicyFile(url);
+ Security.loadPolicyFile("xmlsocket://" + URLUtil.getServerNameWithPort(url));
}
public function log(message:String):void {
View
@@ -300,6 +300,12 @@
WebSocket.__tasks = [];
+ WebSocket.loadPolicyFile = function(url) {
+ WebSocket.__addTask(function() {
+ WebSocket.__flash.loadPolicyFile(url);
+ });
+ }
+
WebSocket.__initialize = function() {
if (WebSocket.__swfLocation) {
// For backword compatibility.

0 comments on commit 0d8d903

Please sign in to comment.