-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Enable RFC6455 (websockets) for streaming endpoints #168
Comments
I notices that the swaggger and openAPi group as thinking of supporting WS as part of the swagger spec. I am currently using GRPC internally, and wrapping with the GRPC gateway, to produce a swagger spec for the outside world. So, if swagger starts to offer WS, then things will be complete. |
preliminary work and kind of hacked up but https://github.com/tmc/grpcutils/blob/master/websocket_proxy.go is an example of wrapping grpc-gateway with a transparent websocket upgrade |
@TMV The code i saw referring to it was in the go-swagger repo. They are these days part of the open-api initiative. I cant remember the exact file. Also i am building a React and React native stack on top of all this and saw your code for generating thats part of the stack at https://github.com/pwmckenna/swagger-models-to-react-proptypes. |
I'm happy to accept streaming support with websockets, but I expect two things in the support.
|
@yugui I think there's a basic argument of just fully expressing grpc's semantics to browser clients. I have starts of basic implementations of flowtype and elmlang generators here https://github.com/tmc/grpcutils and first-class streaming support in grpc-gateway will only motivate more effort in this area. |
@tmc Your code was extremely helpful! I had slightly different requirements and couldn't use gorilla. Shameless plug: https://github.com/shaxbee/go-wsproxy ;-) |
@yugui Currently websocket wrapper is used in application I work on to handle user chat and data changes notifications. |
FWIW I separated that code: https://github.com/tmc/grpc-websocket-proxy |
@tmc Wow. That's excellent. |
I would also like to see this pulled into the main project. It would solve lots of boilerplate hacks for me and probably others. |
I like the implementation of @tmc. Seems the issue has not got any updates in some time. Are you still open to pull it into the project? |
Is there a plan to pull @tmc's implementation into upstream or is there another way to support streaming for web clients that I'm not aware of? |
This hasn't been looked at in a while, but it should still be usable as a third party wrapper if you want to use websockets for bi-directional communications. Note that you can already do client side and server side streaming with vanilla grpc-gateway. What are you trying to do? Maybe join #grpc-gateway on gophers slack and we can discuss. |
Any updates on implementing @tmc's wrapper around grpc-gateway ? |
any updates? |
This will likely never be merged to the gateway directly, but you can still use the wrapper I believe. |
The most reliable way to support streaming (including bidi) to web clients is RFC6455 websockets. Go has a rich implementation for websockets and grpc-gateway should enable grpc streaming endpoints with it.
The text was updated successfully, but these errors were encountered: