nodejs / nodejs/node

http.request socketPath doesn't work on Windows

未关闭
#35,008 8 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

blocked http windows
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

When calling http.request with the socketPath option on Windows in order to try to connect to a Unix domain socket, I get the following error message:

Error: connect ENOTSOCK C:\Users\User\AppData\Local\Temp\test.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

There is native Unix Domain Sockets support in Windows 10 since two years, and the documentation at https://nodejs.org/api/http.html gives no indication that socketPath doesn't work on Windows, so I guess that this can be considered as an error.

  • Version: 12.16.3 (comes with Electron 10.1.0)
  • Platform: Windows 10, 64-bit, Build 18362.19h1_release.190318-1202
  • Subsystem: http
What steps will reproduce the bug?

Call http.request with the socketPath option on Windows. Specify a Unix domain socket path.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 http.request 入口点及其 socketPath 处理开始,使用 net.js:1141:16 的堆栈位置和报告中描述的 Windows 10 复现步骤。使用 Windows 上的 Unix 域套接字验证行为;当文档中说明的 socketPath 行为与受支持平台的行为一致,并且报告的 ENOTSOCK 失败已得到处理时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
networking
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。