Skip to content

usertoken/uws

Repository files navigation

uWS websocket for node


Why

Use

  npm install --save https://github.com/usertoken/uws.git
  const http = require('http');
  const express = require('express');
  const socketIO = require('socket.io');
  const uws = require('uws');

  const app = express();
  const server = http.Server(app);
  const io = socketIO(server);

  io.ws = new uws.Server({ perMessageDeflate: false, noServer: true });

  io.on('connection', (socket) => {
    io.emit('data', 'hello!'); 
    // or
    socket.emit('data', 'hello')
  });


  server.listen(3000, () => console.log('Socket.IO Running...'));

About

port of uWS from C++

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages