mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-17 15:24:52 +00:00
30f4e0829f
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 http.websocket to connect, which will wait until a connection is established and then returns the connection object (an async variant is available). Once you have a websocket object, you can use .send(msg) to transmit a message. Incoming messages will fire a "websocket_message" event, with the URL and content as arguments. A convenience method (.receive()) exists to aid waiting for valid messages. |
||
---|---|---|
.. | ||
dan200/computercraft |