lapis icon indicating copy to clipboard operation
lapis copied to clipboard

Websocket example/support?

Open misha opened this issue 9 years ago • 15 comments

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.

misha avatar Feb 04 '15 01:02 misha

@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.

lordnynex avatar Feb 04 '15 21:02 lordnynex

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.

bdjnk avatar Jun 15 '15 16:06 bdjnk

There is a websocket module there. Is it production ready ?

revskill10 avatar Jul 13 '15 04:07 revskill10

@checkraiser where is there?

nonchip avatar Jul 21 '15 07:07 nonchip

+1 for websockets in lapis.

jots avatar Jan 19 '16 07:01 jots

+1 websockets supported in Lapis

aiibe avatar Jun 06 '18 05:06 aiibe

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

chelog avatar Sep 18 '18 05:09 chelog

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...

nonchip avatar Sep 19 '18 13:09 nonchip

Not having websockets might be a show-stopper. It's 2019 ffs, get it together.

ghost avatar Feb 20 '19 19:02 ghost

@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.

nonchip avatar Feb 20 '19 21:02 nonchip

+1 for websockets in lapis.

nico-abram avatar Mar 06 '19 02:03 nico-abram

Verbal +1 and "me toos" contribute nothing to the thread. If you want to show your support add a :+1: in the appropriate place.

ryanford avatar Mar 08 '19 17:03 ryanford

So, ws when?

eko234 avatar Aug 08 '21 07:08 eko234

@eko234 judging by any other feature ever requested and then possibly implemented since @leafo launched itch.io: when that site needs it.

nonchip avatar Sep 18 '21 05:09 nonchip

  • 1 for websockets

Juniiorf avatar Mar 03 '23 16:03 Juniiorf