mirror of
https://git.coolaj86.com/coolaj86/proxy-packer.js.git
synced 2025-03-12 19:40:52 +00:00
don't assume socket._handle exists
This commit is contained in:
parent
bcd332fea1
commit
7da7746a31
56
index.js
56
index.js
@ -266,34 +266,34 @@ function extractSocketProps(socket, propNames) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket['_' + propName];
|
||||
});
|
||||
} else if (
|
||||
socket._handle
|
||||
&& socket._handle._parent
|
||||
&& socket._handle._parent.owner
|
||||
&& socket._handle._parent.owner.stream
|
||||
&& socket._handle._parent.owner.stream.remotePort
|
||||
) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket._handle._parent.owner.stream[propName];
|
||||
});
|
||||
} else if (
|
||||
socket._handle._parentWrap
|
||||
&& socket._handle._parentWrap
|
||||
&& socket._handle._parentWrap.remotePort
|
||||
) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket._handle._parentWrap[propName];
|
||||
});
|
||||
} else if (
|
||||
socket._handle._parentWrap
|
||||
&& socket._handle._parentWrap._handle
|
||||
&& socket._handle._parentWrap._handle.owner
|
||||
&& socket._handle._parentWrap._handle.owner.stream
|
||||
&& socket._handle._parentWrap._handle.owner.stream.remotePort
|
||||
) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket._handle._parentWrap._handle.owner.stream[propName];
|
||||
});
|
||||
} else if (socket._handle) {
|
||||
if (
|
||||
socket._handle._parent
|
||||
&& socket._handle._parent.owner
|
||||
&& socket._handle._parent.owner.stream
|
||||
&& socket._handle._parent.owner.stream.remotePort
|
||||
) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket._handle._parent.owner.stream[propName];
|
||||
});
|
||||
} else if (
|
||||
socket._handle._parentWrap
|
||||
&& socket._handle._parentWrap.remotePort
|
||||
) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket._handle._parentWrap[propName];
|
||||
});
|
||||
} else if (
|
||||
socket._handle._parentWrap
|
||||
&& socket._handle._parentWrap._handle
|
||||
&& socket._handle._parentWrap._handle.owner
|
||||
&& socket._handle._parentWrap._handle.owner.stream
|
||||
&& socket._handle._parentWrap._handle.owner.stream.remotePort
|
||||
) {
|
||||
propNames.forEach(function (propName) {
|
||||
props[propName] = socket._handle._parentWrap._handle.owner.stream[propName];
|
||||
});
|
||||
}
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user