class

JsonRpc::WebSocketClient

Inherits JsonRpc::Stream / JsonRpc::Client / Reference / Object

Implements JSON-RPC over WebSocket.

Constructors

new(socket : HTTP::WebSocket, remote_address : String, run : Bool = true)

Creates a WebSocketClient from a HTTP::WebSocket. If run is true, the client will start accepting messages right away. If you choose to pass false, then make sure to call #run some time afterwards manually, even if you're only calling remote methods.

Source

Instance methods

close

Closes the connection.

Source
inspect(io)
Source
remote_address

Returns the remote address for display/logging purposes

Source
run

Starts the HTTP::WebSocket read-loop in a background fiber. Make sure to only call this method once, and only if you passed false for run to the constructor.

If you did not do anything fancy, don't call this method.

Source
socket
Source