gimite / web-socket-js

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

work in lighttpd? #153

Closed hjshao closed 7 years ago

hjshao commented 9 years ago

Hello! my environment : server--->lighttpd. websocket server--->tcpserver(written by C) Request Process browser----->lighttpd---(transfer the websocket request)---->tcpserver(deal with data and return) the port for lighttpd is 80: port for tcpserver is 10000 websocket request in browser is like 'http://192.168.121.10/tcp_proxy'.

At this situation, does the web-socket-js work well? thanks!

rfox90 commented 9 years ago

Provided it can connect to your websocket server yes it will work.

Connecting to your websocket server is your business.

hjshao commented 9 years ago

I am understand. I read source of web_socket.rb , in this fn "send_flash_socket_policy_file", the way to return xml for flash_socket is used socket. I want use C to return it in lighttpd without socket, which way should I return, I can't find the way by google? so if you can help me and tell me, thanks

hjshao commented 9 years ago

Excuse me I tried the example but it can not work well in IE8. websocket server is web-socket-ruby, runing on localhost 10081 sample.html is connection to ws://localhost:10081 but it can not work.

gimite commented 9 years ago

I'm not sure if you can handle Flash socket policy file request in lightpd. The protocol is not like HTTP at all. Alternative way is to run stand-alone Flash socket policy file server at port 843. Flash Player first tries port 843, then the port you are connecting to. So it should work if you handle Flash socket policy request either in port 843 or the WebSocket port.

This section has reference to multiple stand-alone Flash socket policy server implementation: https://github.com/gimite/web-socket-js#flash-socket-policy-file