bitmessage-js/tests/ws-node.js
2015-02-10 00:56:55 +03:00

16 lines
360 B
JavaScript

var WsTransport = require("../lib/net/ws");
function start() {
var server = new WsTransport();
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();