Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
a message socket module for node.js
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
delimited.js
example.js
index.js
package.json

README.md

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'})
});
Something went wrong with that request. Please try again.