vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function connectWebRPC

Connects to a WebRPC endpoint.

WebRPCPeer!I connectWebRPC(I) (
  URL url,
  I implementation
)
if (is(I == interface));

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.

Parameters

NameDescription
url URL of the endpoint to connect to
implementation The API implementation to invoke for incoming method calls

Returns

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

Authors

Sönke Ludwig

Copyright

© 2024 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.