I just dealt with this, asked for help in a post here but didn't get much help. It has to do with nat traversal which can be done from your computer. Hours of googling led me to uPnP. You have to forward public requests to your local (private) ip address. I've attached the files that I found and modified to suite my purposes. Here is the actual implementation of the code.
class Ports(object): def __init__(self): # create a folder in c:\\python2x\\lib called uPnP # and extract the zip contents there from uPnP.natpunch import _upnp_ self.ports =  self.uPnP = _upnp_ def open(self, *ports): for port in ports: if not port in self.ports: print 'opening port', port try: self.uPnP.open(port) except: print 'retrying to open port', port sleep(2) self.uPnP.open(port) self.ports.append(port) def closeall(self): print 'closing ports %s' % (', '.join([str(x) for x in self.ports])) self.ports = [p for p in self.ports if not self.uPnP.close(p)] def __del__(self): self.closeall() ports = Ports() # will go through the process of testing # the best method to open the router ports ports.open(15000) # should open port 15000 # keep the 'ports' reference alive # otherwise it will close the ports # when it is garbage collected (the __del__ method)
Also helpful was pyStun which allows to get easily get your public ip address programmatically.
Edited 4 Years Ago by ihatehippies: n/a
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I have expanded the program so that it also ...
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...