socketio / socket.io

Realtime application framework (Node.JS server)
https://socket.io
MIT License
60.88k stars 10.09k forks source link

Will there be a update for the new uWebSockets? #3601

Closed Spejik closed 4 years ago

Spejik commented 4 years ago

You want to:

Current behavior

What is actually happening?

When I tried to use the original uws package, I got a compilation error. When I used the new uWebSockets, some of the methods were missing.

Expected behavior

What is expected?

Setup

Other information (e.g. stack traces, related issues, suggestions on how to fix)

I'm not using socket.io for a web app, I'm creating a game in ue4 with the ue4-client. I was just thinking if you guys could implement it somehow? So that it works with the new uWebSockets? I found that the UDP protocol which uWebSockets uses is much better for games than TCP, so that'd be great. Thanks for your time

dkMorlok commented 4 years ago

uws is dead, you can use alternative https://www.npmjs.com/package/eiows just configure socket.io server with wsEngine: 'eiows'

darrachequesne commented 4 years ago

I found that the UDP protocol which uWebSockets uses is much better for games than TCP

I'm not sure uWebSockets uses UDP under the hood. More info here: https://gafferongames.com/post/why_cant_i_send_udp_packets_from_a_browser/

The uWebSockets.js package does not implement the API of ws, so it can't be used as is. A wrapper could be added though.

As noted by @dkMorlok, a fork of the original uws package is available:

// $ npm install eiows
const io = require('socket.io')(3000, {
  wsEngine: 'eiows'
});

Source here: https://github.com/mmdevries/eiows