UDP over the www

Hi, I made a client and server program using the UDP connection. When I try and run it on my lan it works fine. Everything works right and lets me log into the server, but when I try to do it over the net, there is no connection or anything being send. Does UDP not work over the www only on lan? Or did I miss something… I am behind a router so I tried setting up port forwarding like so:
App: Client2, Port From: 21567, Protocol: Both, IP Address:, Port to: 21568, and enable


My code:

# Server program

from socket import *
import threading
import time

# Set the socket parameters
host = ""
port = 21568
port2 = 21567
buf = 1024
buf2 = 1024
addr = (host,port)

# Create socket and bind to address

data,addr = UDPSock.recvfrom(buf)
client = data
addr2 = (client, port2)
data,addr = UDPSock.recvfrom(buf)
if data == "Hey you there?":
                             data = "Yes"
			     print client, " trying to log on."

# Receive messages
while 1:
        data,addr = UDPSock.recvfrom(buf)
        if not data:
		print "Client has exited!"

		data2 = "Users/" + data + ".txt"
		f = open(data2,"r")
		lineList = f.readlines()
		name = data
		name2 = "Name: " + data + "\n"
		if name2 == lineList[0]:
				  data,addr = UDPSock.recvfrom(buf)
				  password = "Password: " + data + "\n"
				  if password == lineList[1]:
						        print name,"log on."
							data = name
							data = "===Welcome==="
						        while 1:
								class receiver(threading.Thread) :  # Receiver thread
  								  def __init__(self, socket ):
   								  def run(self) :
      									while True :                           # Receive thread
            									data,addr = UDPSock.recvfrom(buf)
            									if not data : break
            									print data
								while True :                                 # Send in main thread
   									data = time.ctime() + " Mradr: " + raw_input()

                                       			print "Wrong."
				print "No one by that name."  

# Close socket

UDP works over the web, some thing with your firewall/connection
Panda has its own UDP library.

Do you know how to set up the fire wall it self to work with the connection? I’ve tried for weeks now with no luck and its getting kinda of annoying lol.

sorry no one can trouble shoot firewalls over forum.

Getting UDP through a NAT firewall is so painfully difficult that it’s just plain a bad idea to even try. My suggestion - if you’re having this much trouble, do you really want the people who play your game to have to go through the same thing?

My suggestion is, use TCP.

the games i play use UDP and normally its no issue. People some times use UPD for nat punch through because you cant use TCP for that.