Skip to content

Commit

Permalink
Deal gracefully (although in a hackish way) with the impossibility to…
Browse files Browse the repository at this point in the history
… open port 843 under Linux. The server will serve Flash policy files on its own port instead of port 843.
  • Loading branch information
ignacio committed Jan 10, 2011
1 parent 8571e5e commit 3b784c9
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions socket-io/transports/flashsocket.lua
Expand Up @@ -75,19 +75,18 @@ function Flashsocket.init (listener)
socket:finish(policy(listeners))
--socket:destroy()
end
end)

netserver:on("error", function(self, err)
if err == 13 then
listener.options.log([[Your LuaNode instance does not have root privileges.'
This means that the flash XML policy file will be
served inline instead of on port 843. This will slow
connection time slightly]])
end
netserver = nil
end)

--try {
netserver:listen(843)
--} catch(e){
--if (e.errno == 13) {
--listener.options.log('Your node instance does not have root privileges.'
-- + ' This means that the flash XML policy file will be'
--+ ' served inline instead of on port 843. This will slow'
--+ ' connection time slightly');
--}
--netserver = null;
--}
netserver:listen(843)
end

-- Could not listen on port 843 so policy requests will be inline
Expand Down

0 comments on commit 3b784c9

Please sign in to comment.