Is there a solution to connect to a local ServerSocket from my browser?

I've written an midlet that opens a local file (wml /html) starting the WAP browser by platformRequest. I need to know wether the user followed a link in that file or not.

At the moment I start a simple ServerSocket on port 9999. I try to open it by a link inside the WAP page. I tried several targets http://localhost:9999/ or but I get no connection.The browser connects to my WAP Gateway, which should not be neccessary. I suppose in result is interpreted as the WAP-Gateway?

Is there any other solution to get notified by browser triggered network events?