Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gRPC server in Python with Unix domain socket

Will gRPC support in Python allow me to implement a server that listens on a Unix domain socket (as opposed to a port)? I am using Python 3.5.3 and grpcio/grpcio-tools 1.18.0.

So far, I have not been able to find any relevant example nor direct evidence. The official examples use server.add_insecure_port('[::]:50051'), and its not clear how a socket could fit there.

like image 520
rookie099 Avatar asked Feb 23 '19 18:02

rookie099


1 Answers

Apparently add_insecure_port(address) accepts Unix domain sockets in the format unix://var/run/test.sock after all.

like image 81
rookie099 Avatar answered Oct 26 '22 10:10

rookie099