import ssl, socket, sys from urllib.parse import urlparse _, URL = sys.argv PARSED = urlparse(URL) ctx=ssl.create_default_context() ctx.check_hostname=False ctx.verify_mode=ssl.CERT_NONE with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s: ss = ctx.wrap_socket(s,server_hostname=PARSED.hostname) ss.connect((PARSED.hostname,PARSED.port or 1965)) ss.send((URL+"\r\n").encode("utf-8")) out = b"" while (data:=ss.recv(1024)): out+=data sys.stdout.buffer.write(out) gemini://tilde.team/~khuxkm/testclient.py

-- Leo's gemini proxy

-- Connecting to tilde.team:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/plain

-- Response ended

-- Page fetched on Thu Oct 28 05:38:46 2021