Socket
Book a DemoInstallSign in
Socket

irc-protocol

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irc-protocol

Streaming parser and serialiser for IRC protocol data

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
2
Created
Source

IRC-Protocol build status

Streaming parser and serialiser for IRC protocol data.

Overview

This module allows you to consume and produce IRC protocol messages. It doesn't contain any logic, leaving that up to the developer. Also everything is streams.

Installation

Available via npm:

$ npm install irc-protocol

Or via git:

$ git clone git://github.com/deoxxa/irc-protocol.git node_modules/irc-protocol

Usage

Also see proxy.js.

#!/usr/bin/env node

var net = require("net"),
    IRCProtocol = require("./index");

var server = net.createServer(function(local) {
  var local_parser = new IRCProtocol.Parser(),
      remote_parser = new IRCProtocol.Parser(),
      local_serialiser = new IRCProtocol.Serialiser(),
      remote_serialiser = new IRCProtocol.Serialiser();

  var remote = net.createConnection(6667, "127.0.0.1");

  local.pipe(local_parser).pipe(local_serialiser).pipe(remote);
  remote.pipe(remote_parser).pipe(remote_serialiser).pipe(local);

  local_serialiser.on("data", function(data) { process.stdout.write(">> " + data); });
  remote_serialiser.on("data", function(data) { process.stdout.write("<< " + data); });
});

server.listen(6668);

License

3-clause BSD. A copy is included with the source.

Contact

Keywords

irc

FAQs

Package last updated on 13 Feb 2015

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