Code Monkey home page Code Monkey logo

fastws's Introduction

Metrics

fastws's People

Contributors

dependabot[bot] avatar hans00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

iznotek

fastws's Issues

[Server] ws.remoteAddress unexpected value

I'm running a simple server based on the examples:

    const fastWS = require('fast-ws/server');

    const options = {};
    const app = new fastWS(options)

    app.ws('/db', ws => {
      console.log(`Connected ${ws.remoteAddress}`)

      ws.on('message', ({ data }) => {
        console.log(`Received: ${data}`);
        ws.sendMessage(data)
      })

      ws.on('echo', ({ reply, data }) => {
        reply(data)
      })
    });

    const [host, port] = ['127.0.0.1', 8080];
    app.listen(host, port, () => {
      console.log(`Listen on ${host}:${port}`)
    })

Unfortunately, when I connect using the code below:

  const Client = require('fast-ws/client')

  const options = {
    // Ping Interval (not less then server `idleTimeout`)
    pingInterval: 30000, // Default (ms)
    // Reply Timeout (Event reply)
    replyTimeout: 5000, // Default (ms)
    // parser options (same as server)
    parserOptions: {},
    // Others options for package 'ws'
  };
  
  const ws = new Client('ws://127.0.0.1:8080/db', options)

I get this output upon connection:
Connected 7f00:0001:

IPv6 is disabled, so I have no idea what this value actually is.

Cheers.

nice finally XD a wrapper

can you benchmark this vs socket io, I really wanted to use this newly renamed uws xD but looking for a beautiful wrapper that I can fully understand.

[BUG] Unable to compile on Windows as the 'ls' command does not exist

Hi,
I've just gotten around to recompiling this package. There appears to be no guides available. which would be rather helpful.

On Windows one must install msys2 or WSL in order to provide the missing 'ls' command.

My process to install on Windows:

- Download vs2017 from website: https://visualstudio.microsoft.com/vs/older-downloads/
- Download and install msys2. Open it and type 'pacman -Syu', close and run this step again to finish updating.
- Add this path to the PATH environment variable 'C:\msys64\usr\bin'
- Run these commands to setup your vs2017 environment:
npm config set msvs_version 2017 –global (not sure if required)
npm config set python python2.7 (not sure if required)
- Run 'npm install -S fast-ws'

My process on Ubuntu: (untested)

- Run: 'sudo apt-get install build-essential'
- Run: 'sudo npm install -g node-gyp'

Move to N-API

Currently uWebSocket.js is using V8 API.
Consider to use N-API will get more compatibility.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.