Created
February 10, 2013 18:27
-
-
Save Eugeny/4750504 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
import socket | |
import gevent | |
from gevent.pywsgi import WSGIServer | |
addrs = socket.getaddrinfo('::1', 8000, socket.AF_INET6, 0, socket.SOL_TCP) | |
bind_spec = addrs[0][-1] | |
listener = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) | |
listener.bind(bind_spec) | |
server = WSGIServer( | |
listener, | |
lambda a,b:'asd' | |
) | |
server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment