Add uws adapter and server #483
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add uws adapter, equivalent of the socketio adapter but using WebSocket directly and with the reconnection logic from the janus adapter.
You can easily compare
src/adapters/naf-socketio-adapter.js
andsrc/adapters/naf-uws-adapter.js
if you're interested in the implementation.Add the uws server based on https://github.com/uNetworking/uWebSockets.js
see comments in the
server/uws-server.cjs
if you're interested in running it. This is the exact equivalent ofserver/socketio-server.cjs
that includes room instancing.On Raspberry Pi 400, 70 moving users with socketio were taking 100% of cpu, with uws server only 30%.
https://x.com/vincentfretin/status/1866053292972822729