Sorry for the very late reply to this question. Yes, this is possible in
Go by providing a custom dialer to grpc:
https://pkg.go.dev/google.golang.org/grpc#WithContextDialer
It would look something like:
myDialer := net.Dialer{LocalAddr: <your network interface address info
here>}
client, err := grpc.Dial(target, <other options>,
grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn,
error) {
return myDialer.DialContext(ctx, "tcp", addr)
})
On Thursday, July 11, 2019 at 5:33:12 AM UTC-7 [email protected] wrote:
> Can grpc-go bind grpc client to specific network interface?
>
> On Saturday, April 27, 2019 at 6:37:35 AM UTC+8, Carl Mastrangelo wrote:
>>
>> What language?
>>
>> On Friday, April 26, 2019 at 2:58:08 PM UTC-7,
>> [email protected] wrote:
>>>
>>> Is it possible to pass a parameter to grpc that allows clients to pick a
>>> specific network interface on a computer with multiple ethernet interfaces?
>>>
>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/a43ac957-a131-4849-b6fc-22af67ed0d6fn%40googlegroups.com.