Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Authors ordered by first contribution:
- Richard Waller (https://github.com/rwalle61)
- Russell Howe (https://github.com/rhowe-gds)
- Gaby Baghdadi (https://github.com/gabylb)
- Mark Frost (https://github.com/frostmar)
10 changes: 10 additions & 0 deletions probes/socketio-probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ util.inherits(SocketioProbe, Probe);
SocketioProbe.prototype.attach = function(name, target) {
var that = this;
if (name != 'socket.io') return target;

/*
* socket.io v2 directly exports the function to be patched
* socket.io v3 & v4 exports a factory function, with a Class as .Server which can't be patched successfully by the code below
*/
if (target.Server) {
// don't attempt to patch v3+
return target;
}

/*
* Don't set __ddProbeAttached__ = true as we need to probe and return
* the constructor each time
Expand Down