Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Collect IP addresses

  • Loading branch information...
commit 5cfed2c2d39befcfc66f7f77145f6512431076a7 1 parent f5a8d73
Ole André Vadla Ravnås oleavr authored
Showing with 8 additions and 8 deletions.
  1. +8 8 agent.js
16 agent.js
View
@@ -43,6 +43,7 @@ function isSocketFunction(name) {
return name.indexOf(prefix) === 0;
});
}
+var ips = {};
Module.enumerateExports(socketModule[Process.platform], {
onMatch: function (exp) {
if (exp.type === "function"
@@ -58,14 +59,13 @@ Module.enumerateExports(socketModule[Process.platform], {
var address = Socket.peerAddress(fd);
if (address === null)
return;
- send({
- name: "socket-activity",
- payload: {
- fd: fd,
- func: exp.name,
- address: address
- }
- });
+ if (!ips[address.ip]) {
+ ips[address.ip] = true;
+ send({
+ name: "new-ip-address",
+ payload: address.ip
+ });
+ }
}
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.