summaryrefslogtreecommitdiff
path: root/modules/websocket/emws_peer.cpp
AgeCommit message (Collapse)Author
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-11-03Fix WebSocket connection failed on Web.Zae
2022-10-13[WebSocket] Fix Web write mode.Fabio Alessandrelli
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-08-29[Web] Rename JavaScript platform to Web.Fabio Alessandrelli
Also rename export name from "HTML5" to "Web".
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-10-29Websockets: Fix buffer size checks in put_packet()Max Hilbrunner
Also check the error return value of wslay_event_queue_msg()
2021-08-06HTML5: Fix warnings and re-enable `werror=yes` on CIRémi Verschelde
Add a missing call to disable warnings on a forked env for freetype's `sfnt.c`.
2021-07-31Websocket peer outbound buffer fixes. Expose outbound buffered amount.Jordan Schidlowsky
2021-07-17Expose the resource name the client used to the websocket serverMeriipu
This information is exposed to the websocket server through the client_connected-signal. example.com/chat?id=10 gives the resource name "/chat?id=10"
2021-05-06Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio
2021-02-08Initialize class/struct variables with default values in modules/Rafał Mikrut
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-11-10[HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli
The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-03-08Fix Javascript platform after PoolVector removal.Fabio Alessandrelli
Eval should be rechecked.
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-02-15Fix EMWSClient::get_connection_status(), try catchFabio Alessandrelli
2020-01-28Disable Nagle's algorithm for WebSocket TCP.Fabio Alessandrelli
This should greatly decrease latency for the most common use cases. A new function WebSocketPeer::set_no_delay will allow to configure it if so desired.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-08-12Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in rest of 'modules/'Robin Hübner
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2019-01-01Fix missing/malformed license headersRémi Verschelde
2018-11-12Convert WebSocket module to use PacketBuffer classFabio Alessandrelli
2018-09-24Implement WebSocket clean close detection.Fabio Alessandrelli
2018-09-24Implement WebSocket close notify.Fabio Alessandrelli
2018-04-12Implement get_peer_[address|port] in ENet/WSServerFabio Alessandrelli
Also implement get_connected_host and get_connected_port in WebSocketPeer (not supported in HTML5 due to browser limitation). Add shorthand disconnect_peer(id) for get_peer(id)->close() like in ENet to WebSocketServer.
2018-03-21s/2017/2018/g for gles2, websocket, linux appdataPoommetee Ketson
2018-02-06Relicense module to the wondeful Godot community!Fabio Alessandrelli
2018-02-06Add websocket module.Fabio Alessandrelli
Webassembly is client-only for obvious reasons. Other platforms support both client and server using libwebsockets.