Skip to content

Instantly share code, notes, and snippets.

@th0m
Created March 30, 2015 09:49
Show Gist options
  • Save th0m/6b1a1d8edbedff191ace to your computer and use it in GitHub Desktop.
Save th0m/6b1a1d8edbedff191ace to your computer and use it in GitHub Desktop.
import socket
HOST = ''
PORT = 5000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
while 1:
data = conn.recv(1024)
conn.sendall(data)
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment