You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.js 694B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const RPCSocketServer_1 = require("../src/backend/RPCSocketServer");
  4. //@ts-ignore
  5. const RPCSocket_1 = require("../src/frontend/RPCSocket");
  6. new RPCSocketServer_1.RPCSocketServer(20000, [{
  7. name: "HelloWorldRPCGroup",
  8. exportPublicRPCs: () => [],
  9. exportRPCs: () => [{
  10. type: 'call',
  11. name: 'echo',
  12. func: async (s) => s,
  13. }],
  14. }], "0.0.0.0");
  15. const caller = new RPCSocket_1.RPCSocket(20000, 'localhost');
  16. caller.connect().then(_ => {
  17. caller.info().then(console.log);
  18. caller["HelloWorldRPCGroup"].echo("x").then(console.log);
  19. });