Unable to connect to Unix socket using node-grpc client
See original GitHub issueI am trying to communicate with a server that is listening on a unix socket - if I use TCP I have no issues, but after much effort have been unable to get it working with the unix socket. Code is
const BIND_SOCKET = '/tmp/collector.sock';
const BIND_TCP = ':9832'; // works fine if I use this for client + server
const PROTO_PATH = './Collector.proto';
const collector = grpc.load({ root: __dirname, file: PROTO_PATH }).collectorv1;
this.client = new collector.Collector(BIND_SOCKET, grpc.credentials.createInsecure());
I have tried many variations on the socket, such as unix:/tmp/collector.sock
and many others I have found online. However none of them work and my write call simply hangs forever, regardless of whether the server is active and listening on the port.
I am using grpc
version 1.10.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:66 (21 by maintainers)
Top Results From Across the Web
gRPC: 14 UNAVAILABLE: failed to connect to all addresses
That gRPC error means that no server is running at the address you are trying to connect to, or a connection to that...
Read more >Agents - Configuration File Reference | Consul
The permissions of the socket file are tunable via the unix_sockets config construct. When running Consul agent commands against Unix socket interfaces, use...
Read more >Device Plugins | Kubernetes
The plugin starts a gRPC service, with a Unix socket under host path /var/lib/kubelet/device-plugins/ , that implements the following ...
Read more >unix-socket - npm search
Enables creation and consumption of Unix domain socket based IPC channels between Node.js apps using JSON-RPC 2.0 as a protocol. domain · inter-process ......
Read more >DogStatsD over Unix Domain Socket - Datadog Docs
Unix Domain Sockets allow you to establish the connection with a socket file, regardless of the IP of ... Then, configure the DogStatsD...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think we can consider this issue to be an actual feature request 😃 Also it might be easier for us to implement this using the pure-javascript version of the library.
@entropitor : Problem with authority header is a story of its own. It is a source of various interoperability issues because the spec does not say what authority header should be if used over UDS. Related issue to grpc implementation in golang (contains a link to rust issue as well) here: https://github.com/grpc/grpc-go/issues/2628.