Skip to content

Instantly share code, notes, and snippets.

@Rizwan-Hasan
Created April 30, 2020 15:39
Show Gist options
  • Save Rizwan-Hasan/bdebb80ab11e513604a2d6595ae67b38 to your computer and use it in GitHub Desktop.
Save Rizwan-Hasan/bdebb80ab11e513604a2d6595ae67b38 to your computer and use it in GitHub Desktop.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost', 1080))
s.listen()
message = "Hello World"
message = bytes(message, "utf-8")
while True:
clt, adr = s.accept()
clt.send(message)
clt.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment