nodejs / nodejs/node

Tracking issue: Stabilizing network inspection in Node.js

Ouverte
#53,946 10 commentaires 10 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

diagnostics_channel inspector never-stale
Langage dominant
JavaScript
Étoiles
122k
Forks
37.4k
Merge moyen
4 j 3 h
PR mergées (30 j)
272

Description

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.requestWillBeSent
  • Network.responseReceived
  • Network.loadingFinished
  • Network.loadingFailed
  • Network.webSocketCreated
  • Network.webSocketClosed
  • Network.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.requestWillBeSent
  • Network.websocketFrameSent
  • Network.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 the diagnostics_channel hook. We need to investigate how to handle the response body. (ref. https://github.com/nodejs/node/pull/53593#discussion_r1658039637)

Related protocols:

  • Network.responseReceived
  • Network.websocketFrameReceived
  • Network.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.requestWillBeSent
  • Network.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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par l’issue associé aux diagnostics et la pull request d’implémentation initiale, puis examinez les entrées non cochées et marquées pour investigation dans les tableaux de fonctionnalités. L’issue ne nomme aucun fichier ni test précis ; pour le terminer, il faudrait sélectionner et implémenter une fonctionnalité restante prête à être traitée, ou terminer l’investigation et la coordination de conception indiquées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, node.js
Domaine
devtools, networking
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.