Created
September 18, 2015 07:25
-
-
Save shonenada/4da76654e1d068fe304c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import socket | |
web_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
web_socket.bind(("127.0.0.1", 8888)) | |
web_socket.listen(5) | |
while(True): | |
connection, address = web_socket.accept() | |
connection.settimeout(120) | |
msg = connection.recv(2048) | |
print msg | |
connection.send("HTTP/1.1 200 OK\r\n\r\nDone\n") | |
connection.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment