denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98.1k stars 5.4k forks source link

Deno.listen w/ unix transport on Windows #18236

Open Hexagon opened 1 year ago

Hexagon commented 1 year ago

Not sure if this is supposed to work or not, but I'll give it a shot:

const listener = Deno.listen({ 
    path: "c:\\temp\\my.sock",
    transport: "unix"
});

listener.close()

error: Uncaught TypeError: ops.op_net_listen_unix is not a function

> deno --version deno 1.31.3 (release, x86_64-pc-windows-msvc)

(Windows 10)

C:\WINDOWS\system32>sc query afunix

SERVICE_NAME: afunix
        TYPE               : 1  KERNEL_DRIVER
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
GJZwiers commented 1 year ago

Supporting Unix sockets on Windows would depend on https://github.com/tokio-rs/mio/pull/1610 I think. Right now you are getting the error because the relevant code is Unix-only and not compiled on Windows.

dojyorin commented 1 month ago

Good news! Rust libs team has accepted Windows AF_UNIX implementation.

https://github.com/rust-lang/libs-team/issues/271