summaryrefslogtreecommitdiff
path: root/modules/websocket/editor
AgeCommit message (Collapse)Author
2022-10-13[WebSocket] Fix debugger implementation.Fabio Alessandrelli
Register module during core initialization so the remote debugger can properly handle the "wss://" protocol.
2022-10-11[WebSocket] Refactor websocket module.Fabio Alessandrelli
This commit is a huge refactor of the websocket module. The module is really old, and some design choices had to be re-evaluated. The WebSocketClient and WebSocketServer classes are now gone, and WebSocketPeer can act as either client or server. The WebSocketMultiplayerPeer class is no longer abstract, and implements the Multiplayer API on top of the lower level WebSocketPeer. WebSocketPeer is now a "raw" peer, like StreamPeerTCP and StreamPeerTLS, so it emits no signal, and just needs polling to update its internal state. To use it as a client, simply call WebSocketPeer.coonect_to_url, then frequently poll the peer until STATE_OPEN is reached and then you can write or read from it, or STATE_CLOSED and then you can check the disconnect code and reason). To implement a server instead, a TCPServer must be created, and the accepted connections needs to be provided to WebSocketPeer.accept_stream (which will perform the HTTP handshake). A full example of a WebSocketServer using TLS will be provided in the demo repository.
2022-03-28Modules: Don't build editor-specific classes in templatesRĂ©mi Verschelde
They're moved to an `editor` subfolder so that we can easily handle them separately.