Commit 73cc285
refactor: use net.client.socket diagnostics channel instead of Socket.prototype.emit monkey-patch
Replace the global Socket.prototype.emit monkey-patch with a subscription
to Node.js's net.client.socket diagnostics channel. This channel fires
when a new TCP/IPC connection is initiated, giving us access to the socket
before the 'lookup' event fires, so we can attach a targeted per-socket
one-time listener instead of patching the global prototype.
Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/d5603429-8e76-46db-bd88-7a315ea660ba
Co-authored-by: fengmk2 <[email protected]>1 parent 4fef0c8 commit 73cc285
1 file changed
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | | - | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
0 commit comments