SquidDev-CC / CCTweaks

Random additions to ComputerCraft (somewhat deprecated, use CC-Tweaked if you're on Minecraft 1.12).
MIT License
12 stars 2 forks source link

WebSockets #132

Closed birbe closed 7 years ago

birbe commented 7 years ago

WebSockets would be a great addition. You can do everything in real-time, and you could even connect to a Discord server if you're that ambitious. There's already an open-source library for WebSockets in Java, so it shouldn't be too difficult. I think what the end result should look like is: ws = os.loadAPI("websockets") ws.connect("ws://...") wsEvent,packet = os.pullEvent("wsreceive") ws.emit("blah",{table})

SquidDev commented 7 years ago

See #107:

CCTweaks currently provided a TCP socket system (modelled off OpenComputer's version). I've had a look at the WebSocket spec and it doesn't look too hard to implement - it is built on top of TCP. I might have a go myself.

More importantly the second paragraph:

My general approach is to not add a feature unless it is impossible or very impractical to implement Lua. WebSockets fall into this category.