Skip to content

Instantly share code, notes, and snippets.

@mudge
Created July 15, 2013 09:06
Show Gist options
  • Save mudge/5998546 to your computer and use it in GitHub Desktop.
Save mudge/5998546 to your computer and use it in GitHub Desktop.
An extremely simple HTTP echo server in Python for testing requests.
import socket
port = 3001
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost', port))
s.listen(5)
while 1:
client, address = s.accept()
data = client.recv(1024)
if data:
print data
client.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment