Is any chance to include WebSocket support I in Drafts API?
No? What would be the use case? WebSockets are for persistent connections, usually for a client-server type application.
The same reason as for http connection, which in some context is also persistent.
I thought about MQTT client (mostly part for sending message), but popular js implementations are based on WebSockets. Some time ago I wrote simple client in REXX language, but I had there standard socket API, which is not available in Drafts JS implementation.
REST API is also client-server. ![]()
Usually the purpose of a socket is to create a long-lived connection where both client and server can pass information back and forth…like having a web app running in a browser that wants updates from the server.
There’s not an equivalent in Drafts. Actions run and end.
If there is compelling reason you need to use a WebSockets based server, you could do it using a browser context in Drafts with HTML previews where you are operating in the Safari context that supports those APIs.
I rather want to create small tcp (or udp) client to connect to external server, but not use http protocol. WebSockets is also used that way.
Socket API in that case is the sequence:
- socket()
- connect()
- send() / receive()
- close()