relay-server
v0.3.1
Published
Server used to relay deltas
Downloads
6
Readme
relay-server
Server used to relay deltas
Example
// Configure a server that takes arbitrary incoming messages and
// accepts them
var servers = RelayServer({
"/*": function acceptEverything(req, res, _, callback) {
var pathname = url.parse(req.url).pathname
jsonBody(req, res, function (err, body) {
if (err) {
return callback(err)
}
callback(null, { uri: pathname, verb: req.method, body: body })
sendJson(req, res, "ok")
})
}
}, {
sharedHttp: true, // use a single HTTP server for write & read
tcp: true // create a TCP server for write & read
})
servers.http.server.listen(8000)
server.tcp.listen(8001)
Installation
npm install relay-server
Contributors
- Raynos