13

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.

1 Answer 1

13

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

More details: https://github.com/grpc/grpc/blob/master/doc/naming.md

Sign up to request clarification or add additional context in comments.

2 Comments

To be clear, this would require three slashes. As an example: channel = grpc.insecure_channel('unix:///tmp/foo/test.sock')
More details on gRPC name resolution can be found here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.