bitmessage-js/tests/ws-node.js

16 lines
373 B
JavaScript
Raw Normal View History

2015-02-09 22:56:55 +01:00
var WsTransport = require("../lib/net/ws");
function start() {
var server = new WsTransport({port: 22334});
2015-02-09 22:56:55 +01:00
server.listen({host: "127.0.0.1", port: 22334});
server.on("connection", function(client) {
client.on("message", function(command, payload) {
if (command === "echo-req") {
client.send("echo-res", payload);
}
});
});
}
start();