bitmessage-js/tests/tcp-node.js

16 lines
349 B
JavaScript
Raw Normal View History

2015-02-06 09:47:40 +00:00
var TcpTransport = require("../lib/net/tcp");
2015-02-05 18:38:36 +00:00
function start() {
2015-02-09 14:38:10 +00:00
var server = new TcpTransport();
server.listen(22333, "127.0.0.1");
server.on("connection", function(client) {
client.on("message", function(command, payload) {
if (command === "echo-req") {
client.send("echo-res", payload);
}
});
});
2015-02-05 18:38:36 +00:00
}
start();