From dbd657646c352b6eb2c1f18c6aa53c20169fab6e Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Wed, 15 Apr 2020 20:56:02 +0100 Subject: [PATCH] Sending packet to the server --- nym-sphinx-wasm/www/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nym-sphinx-wasm/www/index.js b/nym-sphinx-wasm/www/index.js index 21da67402b..4c7620d72f 100644 --- a/nym-sphinx-wasm/www/index.js +++ b/nym-sphinx-wasm/www/index.js @@ -41,7 +41,6 @@ async function main() { const topology = await getTopology(); const mixnodes = topology.mixNodes; const provider = topology.mixProviderNodes[0]; - print("mixnodes", mixnodes); // Construct a route so we can get wasm to build us a Sphinx packet let nodes = []; @@ -50,11 +49,9 @@ async function main() { nodes.push(n); }); let route = new Route(nodes); - print("route", route); // Create the packet - let packet = wasm.create_sphinx_packet(JSON.stringify(route), "foo", "HNNFMsVFknDNFv2TdUstVqKb3hUpajfyPfAA5ZwDPzdK"); - console.log(packet); + let packet = wasm.create_sphinx_packet(JSON.stringify(route), "THIS IS THE MESSAGE", "2ub7f2s5en4Pn2nhY69uyWqGSMLZwhtPASjePq4gLxQs"); // Set up a websocket connection to the gateway node var port = "1793" // gateway websocket listens on 1793 by default, change if yours is different @@ -62,11 +59,13 @@ async function main() { connectWebsocket(url).then(function (server) { server.send("hello gateway"); + console.log(packet); + server.send(packet); }).catch(function (err) { console.log("Websocket ERROR: " + err); }) } -/// +// Let's get started! main(); // utility functions below here, nothing too interesting...