gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 489 forks source link

Removed the call to loadPolicyFile and added a method in the api that can be used to explicitly set the location(s) of the policy file server. #51

Closed jvshahid closed 13 years ago

jvshahid commented 13 years ago

Based on our discussion (https://github.com/gimite/web-socket-js/issues#issue/49/comment/663600) I took the liberty of modifying the code to expose a new method called loadPolicyFile in the api and removed the default call to loadPolicyFile that uses port 843.

I'd expect it to be used like this: if (WebSocket.loadPolicyFile !== undefined) { WebSocket.loadPolicyFile("foobar.com:843"); }

gimite commented 13 years ago

Thanks, pulled. But I modified the code so that it loads policy file on port 843 by default i.e. when WebSocket.loadPolicyFile() is not called. This is for backward compatibility and I think it's better choice in general, especially if you provide socket policy file only on port 843.

Still I believe you can load policy file from the Web Socket port by:

WebSocket.loadFlashPolicyFile("xmlsocket://example.com:80");

if your Web Socket is at port 80.