Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
Spejik opened this issue May 21, 2020 · 2 comments
Closed
1 of 2 tasks

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

Spejik opened this issue May 21, 2020 · 2 comments
Labels
question Further information is requested

Comments

@Spejik
Copy link

Spejik commented May 21, 2020

You want to:

  • report a bug
  • request a feature

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

  • OS: Windows 10
  • browser: -
  • socket.io version: latest

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
Copy link

dkMorlok commented Jul 6, 2020

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

@Spejik Spejik closed this as completed Jul 7, 2020
@darrachequesne
Copy link
Member

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

@darrachequesne darrachequesne added the question Further information is requested label Jul 9, 2020
darrachequesne added a commit that referenced this issue Nov 12, 2021
Usage:

```js
const { App } = require("uWebSockets.js");
const { Server } = require("socket.io");

const app = new App();
const server = new Server();

server.attachApp(app);

app.listen(3000);
```

The Adapter prototype is updated so we can benefit from the publish
functionality of uWebSockets.js, so this will apply to all adapters
extending the default adapter.

Reference: https://github.com/uNetworking/uWebSockets.js

Related:

- #3601
- socketio/engine.io#578
dzad pushed a commit to dzad/socket.io that referenced this issue May 29, 2023
Usage:

```js
const { App } = require("uWebSockets.js");
const { Server } = require("socket.io");

const app = new App();
const server = new Server();

server.attachApp(app);

app.listen(3000);
```

The Adapter prototype is updated so we can benefit from the publish
functionality of uWebSockets.js, so this will apply to all adapters
extending the default adapter.

Reference: https://github.com/uNetworking/uWebSockets.js

Related:

- socketio#3601
- socketio/engine.io#578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants