connectWebRPC

Connects to a WebRPC endpoint.

This will perform a HTTP GET request to the supplied url and attempts to establish a WebSocket connection for bi-directional communication. Incoming method calls will be forwarded to implementation.

connectWebRPC
(
I
)
if (
is(I == interface)
)

Parameters

url URL

URL of the endpoint to connect to

implementation I

The API implementation to invoke for incoming method calls

Return Value

Type: WebRPCPeer!I

A WebRPCPeer instance is returned, which exposes the API interface I for making outgoing method calls.

Meta