Socket
Book a DemoInstallSign in
Socket

message-sockets

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

message-sockets

a message socket

latest
npmnpm
Version
0.2.16
Version published
Maintainers
1
Created
Source

message-sockets

a simple socket transport for node.js. it should support websockets and a json protocol delimited by newlines

var sockets = require('message-sockets');

// use as a client
var socket = sockets.connect('json://myserver.com');

socket.send({from:'client'});
socket.on('message', function(message) {
	console.log(message);
});

// and as a server (80 could also be a server here)
sockets.listen(80, function(socket) {
	socket.send({from:'server'})
});

Keywords

sockets

FAQs

Package last updated on 27 Feb 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