Socket
Socket
Sign inDemoInstall

livereload-protocol

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

livereload-protocol

LiveReload protocol parser


Version published
Weekly downloads
613
decreased by-0.81%
Maintainers
1
Weekly downloads
 
Created
Source

LiveReload protocol parser

Handles LiveReload protocol handshake, validates and parses incoming commands, validates outgoing commands.

Synopsis

var Parser = require('livereload-parser');
parser = new Parser('server', { monitoring: [Parser.protocols.MONITORING_7] });
parser.on('error', function(err) {
  console.error('Error %s when parsing incoming message: %s', err.code, err.message);
  mywebsocket.close();
});
parser.on('connected', function() {
  console.log('Handshake done! Protocols: %j', parser.negotiatedProtocols);
  if (parser.negotiatedProtocols.monitoring >= 7) {
    console.log('TODO: activate monitoring here');
  }
});
parser.on('command', function(message) {
  console.log('Incoming command %s, data %j', message.command, message);
});
mywebsocket.on('data', function(data) {
  parser.received(data);
});

Installation

npm install livereload-protocol

Running tests

npm test

License

© 2012, Andrey Tarantsov, distributed under the MIT license.

FAQs

Package last updated on 09 Oct 2012

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