Describe the feature
|
const originalServe = server.serve; |
|
server.serve = () => { |
|
server.node?.server!.on("upgrade", (req, socket, head) => { |
|
ws.handleUpgrade( |
|
req, |
|
socket, |
|
head, |
|
// @ts-expect-error (upgrade is not typed) |
|
new NodeRequest({ req, upgrade: { socket, head } }), |
|
); |
|
}); |
|
return originalServe.call(server); |
|
}; |
Serve in current node code (above) is adding event listeners on every serve call. Incorrect use (multiple serve calls) leads to unexpected behaviour. Repeated serve calls should either do noting or throw exception.
Additional information
Describe the feature
crossws/src/server/node.ts
Lines 15 to 27 in 03862fb
Serve in current node code (above) is adding event listeners on every serve call. Incorrect use (multiple serve calls) leads to unexpected behaviour. Repeated serve calls should either do noting or throw exception.
Additional information