import socket, sys
port = 70
host = sys.argv[1]
filename = sys.argv[2]
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.sendall(filename + "\r\n")
while 1:
buf = s.recv(2048)
if not len(buf):
break
sys.stdout.write(buf)
----
How to run it:
python gopherclient.py quux.org /
This entry was posted on Thursday, February 18th, 2016 at 16:26 and is filed under Python. You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.