Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data is not compressed even if engine.io has been instructed to do so #474

Closed
1 of 2 tasks
lpinca opened this issue Jan 23, 2017 · 0 comments
Closed
1 of 2 tasks

Comments

@lpinca
Copy link
Contributor

lpinca commented Jan 23, 2017

Note: for support questions, please use one of these channels: stackoverflow or slack

You want to:

  • report a bug
  • request a feature

Current behaviour

The WebSocket server does not compress data.

Steps to reproduce (if the current behaviour is a bug)

Run the following test case

'use strict';

const eioc = require('engine.io-client');
const eio = require('engine.io');
const http = require('http');

const server = http.createServer();
const engine = eio.attach(server, {
  perMessageDeflate: { threshold: 0 }
});

engine.on('connection', (socket) => {
  socket.on('message', (data) => socket.send(data));
});

server.listen(3000, () => {
  const socket = eioc('http://localhost:3000', {
    perMessageDeflate: { threshold: 0 },
    transports: ['websocket']
  });

  socket.on('open', () => {
    socket.send('Hello');
    socket.transport.ws._socket.once('data', (data) => {
      console.log(data);
      // => <Buffer 81 06 34 48 65 6c 6c 6f>
      // an uncompressed WebSocket text frame
    });
  });
});

Expected behaviour

The received WebSocket frame should be compressed.

Setup

  • OS: macOS
  • browser: -
  • engine.io version: 2.0.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

The issue seems to be caused by uws which apparently does not compress the data despite having been instructed to do so. The above example works as expected with engine.io@1.8.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant