#!/usr/bin/python import socket host = "localhost" port = 9992 buf = 1024 addr = (host,port) #create an INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) #now connect to the web server on port 80 # - the normal http port s.connect(('localhost', 9992)) s.sendto(data,addr)