Tracking issue: Stabilizing network inspection in Node.js
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.3k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
Related issue: https://github.com/nodejs/diagnostics/issues/75
Initial implementation: https://github.com/nodejs/node/pull/53593
This issue is for tracking the remaining work to make network inspection in Node.js stable and to provide a comprehensive debugging experience.
Network inspection features
- ✅ - Implemented
- 🚫 - No plan to implement at the moment
- 🔍 - Need further investigation or discussion
Basic information
| Feature | http |
https |
http2 |
fetch |
WebSocket |
|---|---|---|---|---|---|
| type | ✅ #54156 | ✅ #54156 | ✅ #59611 | ✅ #56488 | ✅ #59404 |
| timestamp | ✅ #53593 | ✅ #53593 | ✅ #59611 | ✅ #56488 | ✅ #59404 |
| error | ✅ #54246 | ✅ #54246 | ✅ #59611 | ✅ #56488 |
Related protocols:
Network.requestWillBeSentNetwork.responseReceivedNetwork.loadingFinishedNetwork.loadingFailedNetwork.webSocketCreatedNetwork.webSocketClosedNetwork.webSocketFrameError
Request details
The details of the request, such as the request body, cookies, and query parameters. The Network.Request object is used to represent the request. Some features such as referrerPolicy are only available in browser contexts.
| Feature | http |
https |
http2 |
fetch |
WebSocket |
|---|---|---|---|---|---|
| url | ✅ #53593 | ✅ #53593 | ✅ #59611 | ✅ #56488 | |
| method | ✅ #53593 | ✅ #53593 | ✅ #59611 | ✅ #56488 | |
| headers | ✅ #54156 | ✅ #54156 | ✅ #59611 | ✅ #56488 | |
| postData | 🔍 | 🔍 | ✅ #60483 |
Related protocols:
Network.requestWillBeSentNetwork.websocketFrameSentNetwork.webSocketWillSendHandshakeRequest
🔍 Response details
The details of the response, such as the response body, and headers. The Network.Response object is used to represent the response. Some features such as early hits are only available for browser contexts.
| Feature | http |
https |
http2 |
fetch |
WebSocket |
|---|---|---|---|---|---|
| url | ✅ #54156 | ✅ #54156 | ✅ #59611 | ✅ #56488 | |
| status | ✅ #54156 | ✅ #54156 | ✅ #59611 | ✅ #56488 | |
| headers | ✅ #54156 | ✅ #54156 | ✅ #59611 | ✅ #56488 | |
| mimeType | ✅ #58192 | ✅ #58192 | ✅ #59611 | ||
| body | #60572 | #60572 | ✅ #60483 | ✅ #58001 |
[!CAUTION]
We can't consume the response body within thediagnostics_channelhook. We need to investigate how to handle the response body. (ref. https://github.com/nodejs/node/pull/53593#discussion_r1658039637)
Related protocols:
Network.responseReceivedNetwork.websocketFrameReceivedNetwork.webSocketHandshakeResponseReceived
🔍 Request initiator
The initiator of the request, such as the script URL, the line number, and the stack trace. The Network.Initiator object is used to represent the initiator.
| Feature | http |
https |
http2 |
fetch |
WebSocket |
|---|---|---|---|---|---|
| initiator | ✅ #56805 | ✅ #56805 | ✅ #59611 | ✅ #56805 |
Related protocols:
Network.requestWillBeSentNetwork.webSocketCreated
🚫 Network conditions and throttling
The network conditions and throttling information of the request and response. The Network.emulateNetworkConditions command is used to emulate network conditions.
🚫 Security and authentication information
The security and authentication information of the request and response. The SecurityDetails object is used to represent the security details.
Others
If there are any other features that are not covered by the above categories, please let us know and we will add them to the list.
Node.js specific features
These are network inspection features specific to Node.js applications, including:
- Monitoring incoming requests: Track and inspect incoming HTTP/HTTPS requests to the Node.js server, including headers, body, and timing information.
- Monitoring outgoing responses: Track and inspect outgoing HTTP/HTTPS responses from the Node.js server, including headers, body, and timing information.
These features are not available in the browser context. We plan to support these features in collaboration with the ChromeDevTools team. To move forward with the implementation, we will create a design doc for these features and discuss the specs with the ChromeDevTools team.
Next steps
- Implement the remaining features ready for implementation in the table above
- Investigate the support for WebSocket inspection in Node.js
- Investigate the support for fetch inspection in Node.js
- Investigate the support for HTTP/2 inspection in Node.js
- Document the design doc for Node.js specific features to collaborate with the ChromeDevTools team.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从相关的 diagnostics issue 和初始实现 pull request 开始,然后查看功能表中未勾选的条目以及标记为 investigation 的条目。该 issue 没有指定具体文件或测试;要完成它,需要选择并实现一个已准备好进行开发的剩余功能,或者完成所述的调查和设计协调工作。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- devtools, networking
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100