This would solve...
This will allow Node.js network inspector to monitor request data and response data on Chrome DevTools frontend.
The implementation should look like...
undici:request:sentDataChunk with parameters request, chunk,
undici:request:receivedDataChunk with parameters request, response, chunk.
Essentially, the diag channels shall expose request objects to allow subscribers to identify which request sent/received the data chunk.
I have also considered...
Monkey patching Request.onBodySent and Request.onData to intercept data chunks. The Request object is exposed with undici:request:created diag channel so it is possible to intercept data chunks with monkey patching.
Additional context
Refs: nodejs/node#53946
This would solve...
This will allow Node.js network inspector to monitor request data and response data on Chrome DevTools frontend.
The implementation should look like...
undici:request:sentDataChunkwith parametersrequest, chunk,undici:request:receivedDataChunkwith parametersrequest, response, chunk.Essentially, the diag channels shall expose
requestobjects to allow subscribers to identify which request sent/received the data chunk.I have also considered...
Monkey patching
Request.onBodySentandRequest.onDatato intercept data chunks. TheRequestobject is exposed withundici:request:createddiag channel so it is possible to intercept data chunks with monkey patching.Additional context
Refs: nodejs/node#53946