example_rpc_node.js 524 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
// Javascript RPC server example
// Start and connect to websocket proxy.

// Load Emscripten Module, need to change path to root/lib
const path = require("path");
process.chdir(path.join(__dirname, "../lib"));
var Module = require("../lib/libtvm_web_runtime.js");
// Bootstrap TVMruntime with emscripten module.
const tvm_runtime = require("../web/tvm_runtime.js");
const tvm = tvm_runtime.create(Module);

12
var websock_proxy = "ws://localhost:9190/ws";
13 14
var num_sess = 100;
tvm.startRPCServer(websock_proxy, "js", num_sess)