stas-ut21 / ws-await

Modification of the module ws to wait for a response
MIT License
9 stars 3 forks source link

Are there plans to upgrade this module to use ws 8.3.0? #30

Open lynniemagoo opened 2 years ago

lynniemagoo commented 2 years ago

There is a new version of ws available and I am having issues trying to run ws-await with this version.

It appears they locked down the exports of the library in the 8.X versions to restrict package path usage.

Are there any plans to update to the 8.3.X version and would it even be possible?

lynniemagoo commented 1 year ago

I know this is an older issue. But I have some really good news.

With the latest version of the 'ws' project, 8.9.0, the server now supports passing 'WebSocket' option which is basically the constructor for use when constructing client sockets.

As a result, the entire websocket-server class can be removed from this package. I tested this out last night with a local copy of the library with zero issues. No need for server projects to use the ws-await WebSocket.Server, but instead can use the ws WebSocket.Server and simply supply the following options for example:

// Using my localized version of WebSocketAwait's WebSocket. // Note that using localized version without node's module mapping ensures that Version 8.9.0's // client will extended using this version by the client socket instead of the 7.4.5 version. const WebSocketAwait = require("./lib/websocket.js");

What I'd say on this one is to review your PR you have for the async pong methods and let's upgrade this wonderful module to use the latest 'ws' project.

As the PR has been outstanding for some time, I am wondering if this project is still active. If it is, I'm willing to update the README and the code as needed if you like. From what I'm seeing at the moment, removing websocket-server.js in favor of only a client should be all we need. let wss = new WebSocket.Server({ noServer:true, WebSocket:WebSocketAwait });

lynniemagoo commented 1 year ago

Just tested this library with version 8.13.0 of websocket.js class in your library. It works perfectly. I will note that the current version of websocket-server will not work with the ws library as they changed function signatures as to how client sockets are constructed that websocket-server.js in ws-await chose to override.

Based on recent enhancements to WS discussed above, it is possible to use the ws-await websocket.js class without having to use the ws-await websocket-server.js.

If possible, I would appreciate being able to work on this project of course, that is, if you'd be willing to publish the updates to NPM.

If I don't hear back in 2-3 months, I will likely fork this project and publish my own scoped version of this library.

Thanks, Lynnie