The pitch:
Websockets are a web standard based off the HTTP protocol that allows bi-directional communication between a client and server. In this case, LSL would be the server. A client could be a web browser or another server hosted by a resident.
What makes this different from LSL HTTP is that with Websockets, you are able to keep a session open and communicate back and forth without having to continuously make HTTP requests. Think of it like Websockets is going to someone's house to talk, versus HTTP being sending a letter back and forth over the mail.
Use cases include, but are not limited to:
* Live chat, including that of with an AI
* Time critical syncing such as lighting effects
* Real time input from external sources
The current alternative we have is LSL HTTP, which can be used to behave like websockets, but instead use what is called "HTTP Long polling", which includes issues such as latency and HTTP request overhead, where as with Websockets, once the headers are sent, it is just a chat back and forth without the need for additional headers.
Feasibility:
Websockets use a "message based" system, in which each message is a frame. Each frame has a max size that the server can choose to reject if it is too big by sending a "Frame too big". This is perfect for LSL as it can be limited to specific frame sizes as to avoid stack heap collisions.
Additionally, websockets supports "Binary" and "Text" modes, which LSL can choose to only support text mode (for now), which fits with LSL's strings.
Implementation considerations:
I can think of two ways for this, one would be a single session per object, or single session per region solution. Both have their pros and cons:
* Per object: It is simple, don't have to worry about addressing different handles / scripts / objects, is similar to llRequestURL's syntax. However, you have to open a session for each object you want to communicate with on the region.
* Per region: Slightly more complex, have to specify an handle / script / object ID each frame, but endpoint would be shared between objects.
* Best of both worlds: Make it scripter's choice! (During initial llRequestWebsocket or whatever the function shall be called)