diff options
| author | mo khan <mo@mokhan.ca> | 2015-02-05 22:11:09 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-02-05 22:11:09 -0700 |
| commit | e11cc215122cdd98a7ceccd2e03b85913dc196c6 (patch) | |
| tree | 9e593c562396de8e95d9f8c671d783f7c7ed1e90 /lib | |
| parent | 000634705950a849d2c7f6f90054185d9c85f5c5 (diff) | |
add pry rails and only dump port 80 traffic.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/fake_agent.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/fake_agent.rb b/lib/fake_agent.rb index 410a22d..ad25880 100644 --- a/lib/fake_agent.rb +++ b/lib/fake_agent.rb @@ -63,8 +63,11 @@ class FakeAgent capture.stream.each do |p| packet = Packet.parse(p) if packet.is_ip? - next if packet.ip_saddr == Utils.ifconfig(interface)[:ip_saddr] + #next if packet.ip_saddr == Utils.ifconfig(interface)[:ip_saddr] + next unless packet.ip_saddr == Utils.ifconfig(interface)[:ip_saddr] + next unless packet.try(:tcp_dport).present? && packet.tcp_dport == 80 packet_info = [packet.ip_saddr, packet.ip_daddr, packet.size, packet.proto.last] + #puts packet.dissect puts "%-15s -> %-15s %-4d %s" % packet_info end end |
