Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ObjectStream as a net/http Client #39

Open
abourget opened this issue Jul 31, 2020 · 1 comment
Open

Implement ObjectStream as a net/http Client #39

abourget opened this issue Jul 31, 2020 · 1 comment

Comments

@abourget
Copy link

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..

@keegancsmith
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants