Documentation ¶
Index ¶
- Constants
- func ServerMaker() (jsonrpc.Handler, jrpctest.ClientMaker, func())
- func WebsocketHandler(s jsonrpc.Handler, allowedOrigins []string) http.Handler
- func WsClientHeaders(endpoint, origin string) (string, http.Header, error)
- type Client
- type Codec
- func (c *Codec) Close() error
- func (c *Codec) Closed() <-chan struct{}
- func (c *Codec) Flush() error
- func (c *Codec) PeerInfo() jsonrpc.PeerInfo
- func (c *Codec) ReadBatch(ctx context.Context) (jsonrpc.Bundle, error)
- func (c *Codec) RemoteAddr() string
- func (c *Codec) Write(p []byte) (n int, err error)
- type Server
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ServerMaker ¶
func ServerMaker() (jsonrpc.Handler, jrpctest.ClientMaker, func())
func WebsocketHandler ¶
WebsocketHandler returns a handler that serves JSON-RPC to WebSocket connections.
allowedOrigins should be a comma-separated list of allowed origin URLs. To allow connections with any origin, pass "*".
Types ¶
type Client ¶
func DialWebsocket ¶
DialWebsocket creates a new RPC client that communicates with a JSON-RPC server that is listening on the given endpoint.
The context is used for the initial connection establishment. It does not affect subsequent interactions with the client.
Click to show internal directories.
Click to hide internal directories.