diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2023-10-04 11:37:39 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 11:37:39 +0900 |
commit | da0b945804f19903beac71b23ff1040ebdb9b554 (patch) | |
tree | 8ec0508fbc04839f113b2d58169090d14b474cdd /ext/net/01_net.js | |
parent | 8c1677ecbcbb474fc6a5ac9b5f73b562677bb829 (diff) |
feat(unstable): add unix domain socket support to Deno.serve (#20759)
Diffstat (limited to 'ext/net/01_net.js')
-rw-r--r-- | ext/net/01_net.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/net/01_net.js b/ext/net/01_net.js index 9cdcdb78c..f2bf5e7df 100644 --- a/ext/net/01_net.js +++ b/ext/net/01_net.js @@ -19,6 +19,7 @@ const { ObjectPrototypeIsPrototypeOf, PromiseResolve, SymbolAsyncIterator, + Symbol, SymbolFor, TypeError, TypedArrayPrototypeSubarray, @@ -416,6 +417,8 @@ class Datagram { } } +const listenOptionApiName = Symbol("listenOptionApiName"); + function listen(args) { switch (args.transport ?? "tcp") { case "tcp": { @@ -427,7 +430,10 @@ function listen(args) { return new Listener(rid, addr); } case "unix": { - const { 0: rid, 1: path } = ops.op_net_listen_unix(args.path); + const { 0: rid, 1: path } = ops.op_net_listen_unix( + args.path, + args[listenOptionApiName] ?? "Deno.listen", + ); const addr = { transport: "unix", path, @@ -505,6 +511,7 @@ export { Datagram, listen, Listener, + listenOptionApiName, resolveDns, shutdown, TcpConn, |