lapis
lapis copied to clipboard
Websocket example/support?
I'm exploring the Lapis/OpenResty/Nginx stack for personal project. I noticed that OpenResty has support for websockets; is it possible to reach through Lapis, or integrate websockets somehow? I looked around GitHub and the Lapis reference manual but I didn't find anything.
Examples/documentation/thoughts are welcome.
@msoliter Lapis does not currently support websockets. I've been thinking about this lately for some lapis projects of mine and I think it would be awesome to hear @leafo's thoughts on including support for it. It's a non-trivial change though because of the way openresty/lua-resty-websocket works. As a hack you can implement your websocket loop in another location {} directive and use ngx.location.capture() to pass messages back and forth to lapis. I would not recommend this hack for a heavy traffic scenario.
@leafo if websockets are on the road map (it would be exciting if it was) and you're overhauling the dispatcher I think it would be awesome to have an alternative to serve() which works in the ACCESS phase to bypass the output buffer. Aside from being able to check session state outside a before_filter, I would be able to do basic request validation before passing the request onto the content phase. I've seen a fair bit of requests for lapis in the access phase and I'm curious what your thoughts are on this.
The integration of websockets into Lapis is a feature that interests me as well. It would be good to get input from @leafo on the possibility.
There is a websocket module there. Is it production ready ?
@checkraiser where is there?
+1 for websockets in lapis.
+1 websockets supported in Lapis
Would be a great thing to see websockets in Lapis as we're using it in our community for almost every web thingie
+1 here
interesting to see how there isn't even a simple statement on this feature request for 3 years while implementing websocket support in other non-monolithic-as-hell frameworks that don't even support it yet takes about half an hour of trial and error... seems like @leafo doesn't even care enough anymore to talk to us if it can't sell us an itch.io feature...
Not having websockets might be a show-stopper. It's 2019 ffs, get it together.
@sci4me it's definitely possible using the openresty ecosystem, see also how i did it here using my own framework instead: https://gitlab.com/nonchip/lite-roller.nonchip.de/blob/master/apps/socket.moon
there's just no utilities in lapis for it yet. but if you manage to circumvent enough of lapis' HTTP and output handling code to be able to call resty.websocket.server\new
without it interfering it should work.
+1 for websockets in lapis.
Verbal +1
and "me toos" contribute nothing to the thread. If you want to show your support add a :+1: in the appropriate place.
So, ws when?
@eko234 judging by any other feature ever requested and then possibly implemented since @leafo launched itch.io: when that site needs it.
- 1 for websockets