gRPC-Web client in JavaScript, gRPC server in Python: is it possible?

405 views
Skip to first unread message

Chris Majewski

unread,
Dec 1, 2020, 10:43:26 AM12/1/20
to grpc.io

I'm working on a proof-of-concept using gRPC-Web. I was able to get the Quick Start tutorial working. My next challenge is to adapt this demo by writing a gRPC-Web client in JavaScript that talks to my (very simple) gRPC server written in Python. Is this possible? I am following the Basics Tutorial but it is incomplete. In particular, some of the client-side Javascript code is missing, and the code snippet that is there is different from the corresponding code in the Docker containers from the Quick Start tutorial.

I am able to build the JavaScript stubs for my client. However, my gRPC server (Python) never sees any requests from the client (JavaScript). Not sure if this is due to a bug in my JavaScript, a bug in the Envoy proxy config, or something else. Troubleshooting is difficult because the Docker containers are based on a very minimal Linux install that is missing basic Unix tools.

I can offer to help document this once I get it working, but I would need some help to get it working in the first place.

Thanks!

Chris

Stanley Cheung

unread,
Dec 1, 2020, 6:29:09 PM12/1/20
to Chris Majewski, grpc.io
Does it work if you follow the quick start tutorial and use a Node server? If that works, swap out the Node server with your Python server. That way you can at least be sure that the JS and the Envoy parts are working correctly.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/8fdd4362-e04f-4b40-8819-9cc9293d5720n%40googlegroups.com.

Chris Majewski

unread,
Dec 2, 2020, 7:00:42 AM12/2/20
to Stanley Cheung, grpc.io
Yes, that's what I did. But when I swap out the Node server with my Python server, the Python server doesn't see any of the requests from my client. How can I troubleshoot this? The Docker containers are really minimal, there are almost no devops tools on them. I would like to start by ensuring that the Envoy proxy is configured correctly. I'm able to look at the Envoy logs, but not sure what to look for, and the lack of tools isn't helping. 

Logo
 
image
 
Krzysztof (Chris) Majewski | Software Developer
Sumac / Silent Partner Software
silentpartnersoftware.com
Toll-free 1-877-399-4645
twitterfacebookyoutube

Bilal Ahmad

unread,
Apr 5, 2021, 5:50:52 PM4/5/21
to grpc.io
facing similar issue. did you manage to figure out?

Xavier

unread,
Feb 27, 2024, 2:42:39 PMFeb 27
to grpc.io
This is most probably happening because grpc server accepts http/2 requests and grpc web sends a http1.1 request so you will have to use a envoy proxy server for this
Reply all
Reply to author
Forward
0 new messages