-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Unix Domain Sockets at the client-side? #663
Labels
question
Further information is requested
Comments
Yes. It will require a planned new feature in .NET 5 - https://github.com/dotnet/corefx/issues/35404 |
8 tasks
This has been resolved via the API added here in .NET 5: dotnet/runtime#41949 |
TLDR; using System.Net.Http;
using System.Net.Sockets;
using System.Threading;
using Grpc.Net.Client;
public GrpcChannel ForUnixSocket(string path)
{
var endpoint = new UnixDomainSocketEndPoint(path);
return GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
HttpHandler = new SocketsHttpHandler {
ConnectCallback = async (SocketsHttpConnectionContext _, CancellationToken cancellationToken) => {
var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
try {
await socket.ConnectAsync(endpoint, cancellationToken).ConfigureAwait(false);
return new NetworkStream(socket, true);
} catch {
socket.Dispose();
throw;
}
}
}
});
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, grpc-dotnet supports UDS at the server-side. Are there plans for supporting UDS at the client-side ?
Thanks!
The text was updated successfully, but these errors were encountered: