💾 Archived View for tilde.team › ~khuxkm › testclient.py captured on 2021-11-30 at 19:37:34.

View Raw

More Information

-=-=-=-=-=-=-

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)