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.ts 448B

123456789101112131415161718
  1. import { Server } from '../src/Server'
  2. import {Client} from '../src/Client'
  3. new Server(20000, [{
  4. name: "HelloWorldRPCGroup",
  5. publicRPCs: () => [],
  6. localRPCs: () => [{
  7. type: 'Call',
  8. name: 'echo',
  9. call: async (s:string) => s,
  10. }]
  11. }])
  12. const caller = new Client(20000, 'localhost')
  13. caller.connect().then(_ => {
  14. caller.info().then(console.log)
  15. caller["HelloWorldRPCGroup"].echo("x").then(console.log)
  16. })