1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-17 15:24:52 +00:00
CC-Tweaked/src/main/java
SquidDev 30f4e0829f Add websocket support to HTTP API
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.
2017-11-15 11:32:17 +00:00
..
dan200/computercraft Add websocket support to HTTP API 2017-11-15 11:32:17 +00:00