View Single Post
Old Jan 5th, 2006, 1:14 PM   #12
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Steveire
Yeah, that's a good tip. I was thinking of messing around with the user agent info, and some other stuff, but that might have to wait til the weekend.


This looks like an ingenious way to solve the problem. I didn't know that could be considered, and I would never have thought of it. I have no idea where I'd start writing it, but I'm pretty sure I see what you mean me to do. Submit the form, but send a copy to "home" as well. I'll see if google has the magic.
Here's a simple TCP listener:
import socket
import sys

port = int(sys.argv[1])

sock = socket.socket()
sock.bind(('', port))
sock.listen(1)

while True:
	conn, addr = sock.accept()
	while True:
		data = conn.recv(1024)
		if not data: 
			break
		print data
	conn.close()
It takes the port as it's argument. So to listen on port 80 (default HTTP port):
python tcplistener.py 80
If you run it, and then try accessing http://localhost/, it should print out what your browser is sending to it.
Arevos is offline   Reply With Quote