Coder Social home page Coder Social logo

ss-sockjs's Introduction

SockJS Websocket Transport for SocketStream

SockJS transport integration is built into SocketStream 0.5.0

You can read more about the benefits of SockJS here:

https://github.com/sockjs/sockjs-node (server) https://github.com/sockjs/sockjs-client (client)

Installation

To use SockJS in your app, first add install SockJS:

$ npm install sockjs --save

Then add the following to your app.

ss.ws.transport.use('sockjs');

That's it! The necessary client-side code will automatically be sent to the browser and you don't need to change a line of your application code.

Configuring

Options can be passed directly to the server or client SockJS library. For example, to override the default log function on the server and turn on debugging in the client use:

ss.ws.transport.use('sockjs', {
  client: {
    debug: true
  },
  server: {
    log: function(severity, message){
      console.log('Custom logger >>>', severity, message);
    }
  }
});

Known issues

  1. This is the very first release - expect some issues
  2. SockJS does not handle reconnection as well as Socket.IO. This will be investigated and improved in future

Pull requests welcome on socketstream/socketstream!

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.