Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

websocket-multiplex-client

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-multiplex-client

webSocket-multiplex-client is a nodeJs wrapper on client component of Websocket-multiplex. This helps for writing full end-to-end unit test cases in nodejs

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

Websocket Multiplex Client

Its a NodeJs wrapper on client code for websocket-multiplex. It helps you to do full end to end testing on websocket-multiplexing.

How to use

Below is an sample on how to connect to a sockjs server from code, establish a channel connection and send data.


var sockjsClient = new sockjs_client("http://127.0.0.1:8088/multiplex", 
                                      null, 
                                       { rtt: 201 });
sockjsClient.onopen = function() {
  //Create youre multiplex client
  var client = new multiplex_client(sockjsClient);
  
  //Register the channel
  var mychannel_client = client.channel('mychannel');
  mychannel_client.onmessage = function(msg){
    console.log("Received message", msg);
    done();
  };
  
  //Send message to server on the channel
  setTimeout(function() {
    mychannel_client.send('Hi'); 
  }, 100);
};
sockjsClient.onclose = function() {

View test.js for complete example on how to use the code.

Tests

Run tests using mocha

  mocha test.js

Keywords

FAQs

Package last updated on 04 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc