Skip to content

Unix Domain Socket doesn't support on Windows #55979

Description

@reitowo

Version

20.18.0

Platform

Microsoft Windows NT 10.0.26100.0 x64

Subsystem

No response

What steps will reproduce the bug?

Currently, Windows (at least .NET) supports connect to UnixDomainSocket, or listen to UnixDomainSocket in ASP.NET Core. But node's net module seems not support connect to a Windows local file.

public class UnixDomainSocketsConnectionFactory(EndPoint endPoint) {
   public async ValueTask<Stream> ConnectAsync(SocketsHttpConnectionContext _,
      CancellationToken cancellationToken = default) {
      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;
      }
   }

   public static GrpcChannel CreateChannel(string socketPath) {
      var udsEndPoint = new UnixDomainSocketEndPoint(socketPath);
      var connectionFactory = new UnixDomainSocketsConnectionFactory(udsEndPoint);
      var socketsHttpHandler = new SocketsHttpHandler {
         ConnectCallback = connectionFactory.ConnectAsync
      };

      return GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
         HttpHandler = socketsHttpHandler
      });
   }
}
   protected void Initialize(string token) {
      var builder = WebApplication.CreateBuilder();
      builder.WebHost.ConfigureKestrel(serverOptions => {
         if (!Directory.Exists(MetaBoxStatic.UnixSocketPath)) {
            Directory.CreateDirectory(MetaBoxStatic.UnixSocketPath);
         }

         var socketPath = Path.Combine(MetaBoxStatic.UnixSocketPath, $"MetaBox-{token}.tmp");
         serverOptions.ListenUnixSocket(socketPath);
         serverOptions.ConfigureEndpointDefaults(listenOptions => { listenOptions.Protocols = HttpProtocols.Http2; });
      });

      ConfigureBuilder(builder);
      builder.Services.PostConfigureAll<HostOptions>(opts => opts.ShutdownTimeout = TimeSpan.FromSeconds(1));

      WebApp = builder.Build();
      ConfigureApp(WebApp);
   }

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

The net connects to the "Windows" UnixDomainSocket as it could.

What do you see instead?

EACCESS / ENOENT

Additional information

No response

Activity

  1. bnoordhuis commented on Nov 24, 2024

    @bnoordhuis
    Member

    OP is aware this needs to happen in libuv first, see libuv/libuv#2537 (comment) and note the unsubstantiated performance claim.

  2. added
    windowsIssues and PRs related to the Windows platform.
    libuvIssues and PRs related to the libuv dependency or the uv binding.
    on Nov 24, 2024
  3. reitowo commented on Nov 25, 2024

    @reitowo
    Author

    About performance I'll leave some extra into there.

  4. github-actions commented on Apr 26, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 210 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  5. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 26, 2026
  6. HolonProduction commented on Apr 27, 2026

    @HolonProduction

    This issue is still relevant today. Since VSCode extensions are running on nodejs, implementing Language Server connectivity through domain sockets is currently blocked. This aspect is active part of the considerations around godotengine/godot-proposals#13490

  7. reitowo commented on Apr 27, 2026

    @reitowo
    Author

    You could try push on merging libuv/libuv#4636 :)

  8. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 28, 2026
  9. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 90 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  10. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jul 28, 2026
  11. HolonProduction commented on Jul 28, 2026

    @HolonProduction

    This issue is still relevant today. Since VSCode extensions are running on nodejs, implementing Language Server connectivity through domain sockets is currently blocked. This aspect is active part of the considerations around godotengine/godot-proposals#13490

  12. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    libuvIssues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions