registerWebRPC

fnvoid registerWebRPC(I)(URLRouter router, string path, I implementation, WebRPCPeerCallback!I peer_callback) if (is(I == interface))

Registers a route for handling incoming WebRPC requests.

The endpoint defined by path will attempt to establish a WebSocket connection with the client and subsequently enables bi-directional communication by listening for calls made by the client, as well as invoking the peer_callback to allow the server to make calls, too.

Parameters

routerThe URLRouter on which to register the endpoint
pathPath of the registered endpoint
implementationThe API implementation to invoke for incoming method calls
peer_callbackCallback invoked for each incoming connection