[C++] Modifying rpc url paths

已查看 53 次
跳至第一个未读帖子

Arpit Baldeva

未读,
2017年11月1日 18:01:312017/11/1
收件人 grpc.io
Hi,

Currently, looks like rpc urls are generated in the form of /<package name>/<rpc name>. Is there a way to prefix the urls such that grpc client could call <fixed prefix>/<package name>/<rpc name>? The receiver can chop off the prefix and call the correct rpc.

Use case: We'd like to have a proxy sitting between our client and grpc server. The proxy will serve multiple clients. So a client could call ourdomain.com/<something specific to client>/<package name>/<rpc name>. The proxy will chop off <something specific to client> and reroute the rpc to correct handling instance. 

One option to do it would be via custom header but was wondering if url prefixing has been thought of/brought up before?

Thanks. 

Carl Mastrangelo

未读,
2017年11月2日 13:17:442017/11/2
收件人 grpc.io
You can do this by forking the protoc code generator and adding in the proper path.  The path we use is normalized based on experience at Google, but there is nothing strict about it in the protocol.  I think all grpc libraries support dynamic method dispatch, so you can us pretty much any formula as long as it follows http.

Eric Anderson

未读,
2017年11月2日 13:48:482017/11/2
收件人 Arpit Baldeva、grpc.io
Use a custom header. gRPC does not like alternative paths. It is possible, just a pain.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/65e47a3f-c51e-4d34-b6a0-601badd8091f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arpit Baldeva

未读,
2017年11月2日 17:37:202017/11/2
收件人 grpc.io
Okay - thx for the info. 

As per previous comment about protoc forking,we want to avoid it. The reason being we'd want people to be able to use an off the shelf protoc. 


On Thursday, November 2, 2017 at 10:48:48 AM UTC-7, Eric Anderson wrote:
Use a custom header. gRPC does not like alternative paths. It is possible, just a pain.
On Wed, Nov 1, 2017 at 3:01 PM, Arpit Baldeva <abal...@gmail.com> wrote:
Hi,

Currently, looks like rpc urls are generated in the form of /<package name>/<rpc name>. Is there a way to prefix the urls such that grpc client could call <fixed prefix>/<package name>/<rpc name>? The receiver can chop off the prefix and call the correct rpc.

Use case: We'd like to have a proxy sitting between our client and grpc server. The proxy will serve multiple clients. So a client could call ourdomain.com/<something specific to client>/<package name>/<rpc name>. The proxy will chop off <something specific to client> and reroute the rpc to correct handling instance. 

One option to do it would be via custom header but was wondering if url prefixing has been thought of/brought up before?

Thanks. 

--
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.

Divakar Y

未读,
2018年2月14日 02:26:212018/2/14
收件人 grpc.io
Any update or any other suggestion for the same.
回复全部
回复作者
转发
0 个新帖子