-
Notifications
You must be signed in to change notification settings - Fork 106
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
[Question] stream #760
Comments
Hi, And can i ask why you use envoy proxy? connectrpc has built-in json gateway it self and does not require external gateways like envoy... but if you want reverse proxy it's different... |
https://connectrpc.com/docs/faq/#how-do-i-proxy-the-connect-protocol-through-nginx As the doc said that nginx can't proxy stream. I am using caddy now and it works fine. Next time i will try just use connectrpc's |
Good to see you fixed it, but you know caddy has really bad performance? If performance is important for your project you are in a big trouble. Take a look at the litespeed. I don't know it has streaming features but offers good performance. Good Luck👾🤌🏿 |
That error message looks like it may be related to the HTTP/2-related configuration of your nginx server, and not necessarily related to the use of a server-streaming RPC with nginx.
IIUC, this statement in the FAQs refers to bidirectional streams, which typically cannot work with HTTP 1.1 since they require full-duplex communication (which is only possible when using HTTP/2 or web sockets). The issue with nginx is that it can only use HTTP/2 when communicating with the client, and only supports HTTP 1.1 when communicating with a backend server. So any incoming HTTP/2 request will be downgraded to HTTP 1.1 when proxied to a backend server. But one-way streaming operations are half-duplex -- so they can still work with nginx because they can work with HTTP 1.1.
Yes, streaming definitely works if the client connects directly to the connect server w/out the use of a proxy. A proxy is not necessary for any functionality with connect. Could you possibly provide more details on the nginx and backend server config? What client are you using -- are you using connect-web and, if so, what protocol is the client configured to use? |
These lines in the config look suspicious:
Do you also have web socket endpoints? IIRC, most browsers and most servers do not actually support web sockets over HTTP/2, so this could be the issue. The "upgrade" request header is not supported with HTTP/2. |
Yes, i also have websocket endpoints. I will try to comment the nginx |
@solarhell, if you also need to use web sockets, I'd recommend using plain HTTP 1.1 in the nginx config and not trying to use HTTP/2 at all. That should work fine for web sockets and for one-way streaming with Connect. |
Dear @jhump, The streaming documents for nodejs, connect-web is not complete so much on the site. If i work on them would connectrpc.com welcome that? |
@tahadostifam, thank you for offering. I see you already have a PR over inhttps://github.com/connectrpc/connectrpc.com. I'll add comments over there. |
I have a connectrpc backend server that provides frontend access via Nginx. Now I'm finding some issues with one-way streaming. I checked the documentation suggesting that I should use apache or enovy to proxy the stream.
Is it possible to use the stream method properly if access is provided directly by connectrpc's
http.Server
without any proxy server software?FYI, the one-way stream is like
rpc StreamChat(StreamChatRequest) returns (stream StreamChatResponse);
and the err code in chrome shows:
net::ERR_HTTP2_PROTOCOL_ERROR 200 (OK)
The text was updated successfully, but these errors were encountered: