Skip to content
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

should it support jsonp? #1480

Closed
t2krew opened this issue Jun 23, 2020 · 6 comments
Closed

should it support jsonp? #1480

t2krew opened this issue Jun 23, 2020 · 6 comments

Comments

@t2krew
Copy link

t2krew commented Jun 23, 2020

🚀 Feature

I have a service need to use grpc, but there are some api support jsonp for frontend. If change to use grpc protocol and it should support http(s) too, but I found this project not support jsonp.

@johanbrandhorst
Copy link
Collaborator

What is jsonp?

@t2krew
Copy link
Author

t2krew commented Jun 23, 2020

@johanbrandhorst
Copy link
Collaborator

Looks to me like you can implement your own marshaler and use a custom content-type to support this. I don't think we'll add first class support for this. Please have a look at https://grpc-ecosystem.github.io/grpc-gateway/docs/customizingyourgateway.html for an example.

@t2krew
Copy link
Author

t2krew commented Jun 24, 2020

@johanbrandhorst the custom marshaler can only get the response message from handle, but the JSONP's response also need the callback function name from the url query. so how can I transfer the value from http.Request to the marshal graceful ?

@johanbrandhorst
Copy link
Collaborator

We don't currently have that capability, no, but there was some discussion around adding a ctx parameter to the marshaler for v2, so that things like per-method marshalling could be performed. Would you be interested in contributing something like this?

@t2krew
Copy link
Author

t2krew commented Jun 24, 2020

yes, of course interested if I can, let me first understand your discussion about the second edition, and then try to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants