-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add a client example #3
Comments
@tmc @johanbrandhorst Can you please add an example client code? I cannot get my head around it. I have a "streamingCall" exposed over gRPC. How do I interact with it once I add the wsproxy? |
@prince-mishra you'll need to write a websocket client. It'll depend very much on how you're talking to your server. You can look at https://github.com/johanbrandhorst/gopherjs-grpc-websocket/blob/master/client/client.go for a GopherJS example of how to use the websocket. |
@johanbrandhorst Thank you so much! That helps a lot. I'll be testing it out in the browser. |
@johanbrandhorst using your go client code as referrence, I was able to connect and send messages to the proxy layer. The goes like this:
This means I need to open new websockets for every API. Is there a way to reuse the websocket on client side? Can I use the existing websocket for /v1/bidi and /api2/bidi2? |
I'm afraid I don't know enough about websockets, but it appears you'll need to create a new websocket for each API endpoint. Also the connection will be closed when the bidi stream is closed so you'll need to create a new websocket every time to want to make the call. |
Either using gopherjs or pure JS, just to illustrate how the
MethodOverrideParam
interacts with the grpc-gateway exposed gRPC methods. Probably an example of authentication too would be nice.The text was updated successfully, but these errors were encountered: