Wow, I forgot to respond to this. Apologies! `ServerContext` does give you `peer()` which I believe is filled with the appropriate address. For security related purposes, we do not recommend that this be used though.
You probably want to use a proper authentication mechanism like the ones documented at https://grpc.io/docs/guides/auth/ and then use `grpc::AuthContext()` to get the context per request. On Wednesday, April 13, 2022 at 5:50:13 PM UTC-7 Mingyu Lu wrote: > Can anyone give any advice ? > > On Monday, April 11, 2022 at 8:54:32 AM UTC+8 Mingyu Lu wrote: > >> C/C++ >> >> On Friday, April 8, 2022 at 11:54:06 PM UTC+8 Eric Anderson wrote: >> >>> What programming language are you using? >>> >>> On Fri, Apr 8, 2022 at 7:55 AM Mingyu Lu <silv...@gmail.com> wrote: >>> >>>> Hi, >>>> I am using GRPC with UNIX domain socket. I'd like to have one server >>>> listen on two sockets A and B. >>>> If requests come from A, I'd like to do something but if from B, I want >>>> to do something different. >>>> For security concern, I can't trust what comes from request. >>>> I suppose if I can get server address when requests come in, problem >>>> solved. >>>> Does anyone have any idea ? 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. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/grpc-io/b4c59951-59c3-4b2c-9773-9a5ba6f589f3n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/grpc-io/b4c59951-59c3-4b2c-9773-9a5ba6f589f3n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/df9d0687-3aa3-4271-a711-36b5a51e00dfn%40googlegroups.com.