websockets / ws

Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js
MIT License
21.34k stars 2.3k forks source link

Update websocket.js #2205

Closed t0chk closed 4 months ago

t0chk commented 4 months ago

Fix TypeError: Cannot read properties of undefined (reading 'autoPong') error

if i make an inheriting class like

class AntaresWebsocket extends WebSocket {
  constructor() {
    super(null);
  }

and then

    this.wss = new WebSocketServer({
      WebSocket: AntaresWebsocket,
    });

take TypeError after client connection

lpinca commented 4 months ago

See https://github.com/websockets/ws/pull/2199 and https://github.com/websockets/ws/issues/2188.