mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
a8950f98dd
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. |
||
---|---|---|
.. | ||
doc_classes | ||
editor | ||
config.py | ||
emws_peer.cpp | ||
emws_peer.h | ||
library_godot_websocket.js | ||
packet_buffer.h | ||
register_types.cpp | ||
register_types.h | ||
remote_debugger_peer_websocket.cpp | ||
remote_debugger_peer_websocket.h | ||
SCsub | ||
websocket_multiplayer_peer.cpp | ||
websocket_multiplayer_peer.h | ||
websocket_peer.cpp | ||
websocket_peer.h | ||
wsl_peer.cpp | ||
wsl_peer.h |