WebSocketSite serves also the flash policy file.#2
WebSocketSite serves also the flash policy file.#2kowalski wants to merge 1 commit intowulczer:masterfrom
Conversation
This removes the necessity of having aditional server listening on port 843, which required root priviliges. It can be done like this according to the article: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html.
|
Considering it's just example code I would leave it as is (and to make it easier to eventually merge this fork back into the original repo). It's good to have the example work out of the box with Flash fallbacks like web-socket-js. For production deployments you can use WebSocket.loadFlashPolicyFile('xmlsocket://hostname:port') when using web-socket-js to make it request the policy file from a different port. I think I like the idea that WebSocketSite is not responsible for serving the policy file - it's better to have a separate protocol for that (or subclass WebSocketSite in your code if you really want it to serve both Websockets and Flash policy files). |
|
Oh, by the way I think that the implementation proposed is not safe, although it might not matter in practice. Data can come fragmented from the wire, so checking for |
This removes the necessity of having aditional server listening on port 843, which required root priviliges. It can be done like this according to the article: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html.
This is something you might consider adding or not. Or maybe it should be optional? In any case I need to support the flash fallback and running the process with root privileges is not an option for me.