views:

423

answers:

1

I am building python p2p application like p2p instant messenger. I am communicating with other peers using TCP/IP connection. I do not want client to do port forwarding. When application starts it should check whether port is forwarded to router if not it should forward it to router. Is it possible to programaticaly forward the port to router. Or how can I use port 80 for p2p communication as its used by browsers.

+1  A: 

You may find the post and files listed here helpful. This person implemented a Nat PMP library in Python.

http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/

If you want to use port 80 for p2p communication, you will simply just need to write your own protocol in HTTP and connect over port 80.

Unknown
Hi, can you give me some guidelines for writing http protocol in python. should I use BaseHTTPServer and HTTP protocol client http://docs.python.org/library/httplib.html http://docs.python.org/library/basehttpserver.html
Xinus
@Xinus, sorry I do not have much experience with that. I think most people use httplib. You should ask that as another question.
Unknown