Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Websocket support #395
This uses Netty's websocket functionality, meaning we do not have to depend on another library.
As websockets do not fit neatly into the standard polling socket model, the API is significantly more event based than CCTweaks's. One uses
Once you have a websocket object, you can use
I'd really appreciate feedback on this - I'm not entirely sure it's the best approach, but IMO it's neater than CCTweaks's.
local res, err = http.websocket("wss://echo.websocket.org") if not res then error(err, 0) end for i = 1, 10 do res.send("hello " .. i) print(res.receive()) end res.close()
These are things which probably should be implemented at some point, but I'm looking for some thoughts on them first. Not all of them are entirely websocket related.
I made what I believe to be the first public software to use this PR. It makes a file handle interface to the WebsocketConnection object.