I can just plug in the socket on the same computer using
server:
import socket s = socket.socket() host = socket.socket() port = 8000 s.bind((host,port)) s.listen(5) while true: c,addr = s.accept() print 'got connection from', addr c.send('thank you for connecting') c.close()
client:
import socket s = socket.socket() host=socket.gethostname() port = 8000 s.connect((host,port)) print s.recv(1024)
What changes should be made if it is connected between my laptop and the private server I'm working on? I realized from my searches that portforwarding is the best way to do this, but have not found any explanation or guidance on how to do this.
Thank you
source share