igrigorik/em-websocket

Flash port 843 doesn't response

erickhsiao opened this issue · 1 comments

Perhaps this issue already solved?

I use web-socket-js for IE which connect via flash.
but get no response, I asked web-socket-js and they said it should be support by default.

just wondering any body also face this problem?

em-websocket doesn't listen on port 843 (nor should it)

Flash will try connecting on port 843. If it doesn't get a response it will try requesting the flash policy file on the WebSocket port (which em-websocket will respond to)

If you want to serve the flash policy file on port 843 you can use something super simple like this, possibly in the same process as em-websocket:

require 'eventmachine'

module FlashPolicy
  def post_init
    cross_domain_xml =<<-EOF
    <cross-domain-policy>
       <allow-access-from domain="*" to-ports="*" />
    </cross-domain-policy>  
    EOF

    send_data cross_domain_xml
    close_connection_after_writing
  end
end

EM.run {
  EventMachine::start_server '0.0.0.0', 843, FlashPolicy
}