gimite / web-socket-js

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

<policy-file-request/> on websocket socket #6

Closed slayer closed 14 years ago

slayer commented 14 years ago

Hi sometimes flash sent strange "policy-file-request" on websocket port. I am use tcpick for sniffing:

    # /usr/sbin/tcpick -a -C -yP "port 4005"
    11     SYN-SENT       browser:2192 > server:4005
    11     SYN-RECEIVED   browser:2192 > server:4005
    11     ESTABLISHED    browser:2192 > server:4005
    <policy-file-request/>.
    11     FIN-WAIT-1     browser:2192 > server:4005
    11     TIME-WAIT      browser:2192 > server:4005
    11     CLOSED         browser:2192 > server:4005
mcav commented 14 years ago

That is sent by the Flash player to get authorization that it is allowed to connect to that port. It does that when you aren't running a Socket Policy File server on port 843. See here: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html

gimite commented 14 years ago

If you use web-socket-ruby: http://github.com/gimite/web-socket-ruby it handles Flash Socket Policy File request automatically. Otherwise you need to handle the request at port 843 or the same port as the Web Socket port.