Luigi Pinca
Luigi Pinca
> If I understood correctly the spec, using `on...` remove all the previous handlers, both `on...` and `addEventListener` ones. That's why `on...` ones are totally discouraged and unrecommended in W3C...
> Why the fuck do they have an `EventEmitter` when there's also `EventTarget`? The `EventEmitter` came first and is more efficient in terms of both performance and memory usage. >...
FWIW https://github.com/websockets/ws/commit/0b21c03a6e69f8e37b2dfe55c4e753575fc09ac7 fixes the `ws.on` after `websocket.addEventListener()` issue discussed above.
@stackdev37 it is already like that. ```js function foo() {} function bar() {} websocket.onmessage = foo; websocket.onmessage = bar; ``` In the above example, the `foo` handler is removed when...
See https://github.com/nodejs/node/pull/23284#discussion_r223162692. To answer your question, when someone interested in having the feature, will implement it and open a PR.
@ayZagen you are welcome to experiment with it. ws is built on top of the [upgrade](https://nodejs.org/api/http.html#http_event_upgrade_1) mechanism for HTTP/1.1 and works with a raw (net.Socket) TCP socket. The way WebSocket...
WebSocket over HTTP2 has only one advantage that is as you said the use of a single TCP connection when the origin is the same. In all other cases there...
@adelyte-chris [RFC 8441](https://tools.ietf.org/html/rfc8441) describes how to run the WebSocket protocol over a single stream of an HTTP/2 connection and this is already supported by Node.js. That said, I did not...
If I remember correctly `outgoingMessage._headers` in ws is only used in tests. Should be trivial to fix. I'll take a look when I can.
@davidmurdoch > I've tried to find a way to do this using the `ws` api but `send` seems to require the whole `message`. Fragmented messages are supported in `ws` since...