httptoolkit-ui icon indicating copy to clipboard operation
httptoolkit-ui copied to clipboard

added grpc-web as an content type and mapped it to grpc-proto

Open nutterthanos opened this issue 10 months ago • 6 comments

nutterthanos avatar Feb 21 '25 23:02 nutterthanos

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 21 '25 23:02 CLAassistant

i haven't actually tested it if this format is the same as grpc-proto but i thought it was since it says grpc in the content-type

nutterthanos avatar Feb 21 '25 23:02 nutterthanos

Good idea @nutterthanos! It would definitely be good to support this. It looks like the protocol is very closely related but not identical, although it's hard to tell at a glance whether the differences are important from our perspective. Do you have any good examples of sites using grpc-web I can use for testing?

pimterry avatar Feb 24 '25 16:02 pimterry

Good idea @nutterthanos! It would definitely be good to support this. It looks like the protocol is very closely related but not identical, although it's hard to tell at a glance whether the differences are important from our perspective. Do you have any good examples of sites using grpc-web I can use for testing?

i don't have any atm unfortunately since not many api's or whatever seem to use that content-type

nutterthanos avatar Feb 27 '25 22:02 nutterthanos

for example there is this one that used it: https://ap-prod.api.mcd.com/gma/cxc/mcdonalds.sdui.screen.v1.ScreenService/GetScreen

for some weird reason there is application/grpc-web+proto as well but somehow that already can select gRPC as an content-type in the ui and that works

note that comes from the Mcdonalds app in Australia tho also i think this would happen too This API only works with a near Australian IP but idk

there might be an similar one in the eu app too or whatever

nutterthanos avatar Mar 04 '25 21:03 nutterthanos

I haven't managed to reproduce any of these to test this unfortunately. Can you share a HAR with some grpc-web traffic? Or a website example would be best - really grpc-web is intended to be used as a compatibility form of gRPC for web browsers, so there must be some websites actually using it somewhere surely...?

for some weird reason there is application/grpc-web+proto as well but somehow that already can select gRPC as an content-type in the ui and that works

Yep, that's expected, grpc does the same. The +proto is a general pattern used to describe one format built on top of another. Grpc defaults to being protobuf-based if you don't specify, but you can specify the underlying format if you like, and you can also do grpc over JSON instead (application/grpc+json) if you want.

pimterry avatar Mar 10 '25 18:03 pimterry