import socket

def main():
	if len(sys.argv[1:]) != 4:
		print "Usage: python script.py 127.0.0.1 8888 127.0.0.1 9999"
		sys.exit(0)

	local_host = sys.argv[1]
	local_port = int(sys.argv[2])

	target_host = sys.argv[3]
	target_port = int(sys.argv[4])

	server_loop(local_host, local_port, target_host, target_port)
	forward()


first_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
first_server.bind(("", 5353))
first_server.listen(5)
first_client, first_addr = first_server.accept()
print "First server up"

second_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
second_server.bind(("", 9999))
second_server.listen(5)
second_client, second_addr = second_server.accept()
print "Second server up"

while True:
	first_client.send("Write something \n")
	data = first_client.recv(1024)
	if not data :
		break
	second_client.send(data)
	print "Forwarding data"

first_client.close()
second_client.close()