-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to delivery the websocket across request? #8
Comments
Any one can write a chatting room example use the lua-resty-websocket for me . thx,very |
@ruiyinchen Instead of delivering sockets themselves across different requests, you should delivery data or message. You cannot operate on a cosocket object directly from the context of another request that did not create it. BTW, such general discussions should go to the openresty-en mailing list. See http://openresty.org/#Community |
@agentzh ,thank very much. |
WebSockets with OpenResty by Aapo Talvensaari: |
Here is chat-app that I wrote to demonstrate some of my components for OpenResty Con 2015: For web sockets, see: And: It uses Redis as a backend and pub/sub channel. You could do without Redis and use shared dict for example, but well, take a look. But remember, it is just a demo. It uses resty.websocket, as you can se here (this is an abstraction in my route framework to route websockets packets): |
I want to find all the current connect sock to the websocket server, and send response to them.(a chatting room.) I Save the socks to module table in every request. When I use the saved socks to send response,I found that the socks already closed.How Can I do , I Know the cosocket has the same
lifetime as the request.How can I shared sock across request.
The text was updated successfully, but these errors were encountered: