chore: migrate websocket-stream to ws#1030
Conversation
|
We could also make .handle() accept a websocket + req as well and do the conversion to duplex stream + req within .handle() if that improves developer experience. e.g. instead of: const wss = new ws.WebSocketServer({
server
})
wss.on('connection', (websocket, req) => {
const stream = ws.createWebSocketStream(websocket)
aedes.handle(stream, req)
})one would then just do: const wss = new ws.WebSocketServer({
server
})
wss.on(connection, aedes.handle)However I proposed to the ws project to allow for: const wss = new ws.WebSocketServer({
server,
webSocketStream:aedes.handle
})which would be more clean imo. Kind regards, |
|
I'm +1 for const wss = new ws.WebSocketServer({
server,
webSocketStream:aedes.handle
})so let's wait for that |
Pull Request Test Coverage Report for Build 15711266362Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
We got an answer: the |
|
Ok so no action to do, I think examples are really clear and the code is simple |
This PR migrates Aedes from websocket-stream to ws.
When installing npm modules I got warnings from npm on high-severity issues on websocket stream.
In the discussion at max-mapper/websocket-stream#166 it became clear that the best way forward is to migrate from websocket-stream to ws.
Aedes only used websocket-stream in test but the documentation recommended to use it as well.
I have a question open at ws to see if we can improve the developer experience when setting up a websocket stream, but for now we have a working setup and the documentation has been amended.
KInd regards,
Hans