1

I'm trying to create an application event (java) that would raise as soon as the machine gets connected to gmail onto the login page (https://www.google.com/accounts/), so I'm trying to build a Socket that would listen to this particular httprequest. but I can only create a ServerSocket that listens to a port, to a specific ip adress (gmail login page can have so many different ips), but not to a host... anyone got an idea ? thank you !

KitAndKat
  • 953
  • 3
  • 14
  • 29
  • so, you are trying to write a java program that snoops gmail traffic from a users machine? Sounds pretty dodgy! – Codemwnci Dec 20 '10 at 22:03
  • Can you rephrase your question please? – Alon Gubkin Dec 20 '10 at 22:07
  • no I don't wanna snoop traffic, I just want my java application to raise an event on gmail logging... so technically yes I need to know when the request to gmail's logging page is made, but this is for my local app's purpose that displays some animation at this moment – KitAndKat Dec 20 '10 at 22:11

2 Answers2

1

This should help you get started:

http://gforgeek.blogspot.com/2005/04/simple-packet-sniffer-using-java.html

EDIT:

I just checked and I think you're going to have a really hard time accomplishing this because gmail runs on HTTPS so even once you get the packet sniffer running you're going to have to decrypt all SSL communications. I'm not even sure that's possible.

Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147
0

Best bet is inside the browser like Google's Mail Checker extension for Chrome. Modify the extension to forward notifications to a localhost HTTP service which your Java application is hosting.

Steve-o
  • 12,678
  • 2
  • 41
  • 60