Skip to content

Instantly share code, notes, and snippets.

@Rizwan-Hasan
Created April 30, 2020 15:40
Show Gist options
  • Save Rizwan-Hasan/4837ed65ef36c6fe1bc2bef60bb39cd4 to your computer and use it in GitHub Desktop.
Save Rizwan-Hasan/4837ed65ef36c6fe1bc2bef60bb39cd4 to your computer and use it in GitHub Desktop.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 1080))
message = ''
while True:
msg = s.recv(1)
if len(msg) <= 0:
break
else:
message += msg.decode("utf-8")
print(message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment