shadowsocks/tests/graceful_server.py

14 lines
249 B
Python
Raw Normal View History

2015-08-02 06:37:44 +00:00
#!/usr/bin/python
import socket
if __name__ == '__main__':
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('127.0.0.1', 8001))
s.listen(1024)
c = None
while True:
c = s.accept()