Open abourget opened 4 years ago
jsonrpc2
requires bidirectional communication, so if you want to go via http you can upgrade a client connection to websockets. See the websocket package https://godoc.org/github.com/sourcegraph/jsonrpc2/websocket
Alternatively you can create an HTTP handler to do "one-shot" communication. IE a handler which will take in a body of json (which are jsonrpc2 requests) and proxy them on to a jsonrpc2 endpoint. We used to do this at Sourcegraph.
Any chance we could have samples of how to integrate
http.Client
into the flow?The lib is nice and clean, but not easy to get started with a simple use case of hitting an HTTP server. Requiring TCP-socket level abstraction forces it into unsecure http only..