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

grpc-gateway can run inside the same process #12

Open
achew22 opened this issue Jun 24, 2018 · 4 comments
Open

grpc-gateway can run inside the same process #12

achew22 opened this issue Jun 24, 2018 · 4 comments
Labels

Comments

@achew22
Copy link

achew22 commented Jun 24, 2018

Really nifty project. Thanks for open sourcing! This looks like a great resource for the community.

I was just looking through the code and it seems I have done a poor job of documenting gRPC-gateways' ability to serve from inside the same process. In our example grpc server we allow you to pass in a network which could be a "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket". All of the unix class ones would take a system path as "addr" and let you serve all traffic without opening a TCP connection.

How could I help make that more clear?

@utrack
Copy link
Owner

utrack commented Jun 24, 2018

Sorry, my documentation is poorly worded - I've been meaning to say "zero additional marshalling steps/hardwired to own code", but in a simpler way :) I'll think of how to say it better in the morning.

It would be cool to exchange ideas and merge the projects sometime, what do you think?
We could split the generation of an HTTP handler a-la clay and then use the result as an HTTP-input pipeline in gen-gateway.

@utrack utrack added the docs label Jun 24, 2018
@achew22
Copy link
Author

achew22 commented Jun 25, 2018

Does that mean that you call the interceptors for the user?

@utrack
Copy link
Owner

utrack commented Jun 25, 2018

Nope, now they're used only for gRPC calls, while separate HTTP middlewares are used for HTTP calls. It's a possible thing to do, however we haven't focused on it yet.

E: for future readers, now common interceptors are called for both gRPC and HTTP calls.

@utrack
Copy link
Owner

utrack commented Jun 25, 2018

## Alternatives
There's also an excellent [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) proxy generator. It allows you to split your HTTP endpoints to a separate HTTP gateway instance at the expense of flexibility.

Would it be OK for you?

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

No branches or pull requests

2 participants