Skip to content

Decompression does not work on Node.js >= 12 if the BFINAL bit is set to 1 #1669

Closed
@jeffrson

Description

@jeffrson

Description

I want ws to connect to a self written WebSocket Server based on https://github.com/sta/websocket-sharp.
While the test program works when using NodeJS 10.17.0, it doesn't with v12 or v13 - although the client connects and can send data successfully to the server, it does not show any received data. Since it does not seem to respond on "ping", the server library closes the connection after some time.

The server cannot be too wrong, since another short test with https://github.com/theturtle32/WebSocket-Node succeeds.

Reproducible in:

  • version: 7.2.0
  • Node.js version(s): 13.3.0, 12.13.1
  • OS version(s): Windows 10

Attachments:


const WebSocket = require('ws');
const ws = new WebSocket('ws://127.0.0.1:12345/test');

ws.on('open', () => {
  ws.on('message', data => console.log(data))
  ws.on('close', error => console.log('close'))
  ws.on('error', error => console.log(`Error: ${error}`))
  ws.on('unexpected-response', error => console.log('unexpected-response'))
  ws.on('upgrade', error => console.log('upgrade'))
  ws.on('ping', () => console.log('ping'))
  ws.on('pong', data => console.log('pong'))

  let login = {
      name: "TEST",
  }

  ws.send(JSON.stringify(login))
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions