summaryrefslogtreecommitdiff
path: root/ext/net/01_net.js
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-10-04 11:37:39 +0900
committerGitHub <noreply@github.com>2023-10-04 11:37:39 +0900
commitda0b945804f19903beac71b23ff1040ebdb9b554 (patch)
tree8ec0508fbc04839f113b2d58169090d14b474cdd /ext/net/01_net.js
parent8c1677ecbcbb474fc6a5ac9b5f73b562677bb829 (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.js9
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,