Merge b01dbb0434
into 6fb09ea8af
This commit is contained in:
commit
cc0add4976
2 changed files with 22 additions and 10 deletions
|
@ -145,7 +145,7 @@ class Socks5Server(SocketServer.StreamRequestHandler):
|
|||
|
||||
def main():
|
||||
global SERVER, REMOTE_PORT, PORT, KEY, METHOD, LOCAL, IPv6
|
||||
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format='%(asctime)s %(levelname)-8s %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S', filemode='a+')
|
||||
|
@ -167,7 +167,7 @@ def main():
|
|||
METHOD = None
|
||||
LOCAL = ''
|
||||
IPv6 = False
|
||||
|
||||
|
||||
config_path = utils.find_config()
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:b:p:k:l:m:c:6')
|
||||
for key, value in optlist:
|
||||
|
@ -179,7 +179,13 @@ def main():
|
|||
with open(config_path, 'rb') as f:
|
||||
config = json.load(f)
|
||||
else:
|
||||
config = {}
|
||||
config = {"server": "127.0.0.1",
|
||||
"server_port": 8388,
|
||||
"local_port": 1080,
|
||||
"password": "barfoo!",
|
||||
"timeout": 600,
|
||||
"method": "table"
|
||||
}
|
||||
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:b:p:k:l:m:c:6')
|
||||
for key, value in optlist:
|
||||
|
@ -209,7 +215,7 @@ def main():
|
|||
sys.exit('config not specified, please read https://github.com/clowwindy/shadowsocks')
|
||||
|
||||
utils.check_config(config)
|
||||
|
||||
|
||||
encrypt.init_table(KEY, METHOD)
|
||||
|
||||
try:
|
||||
|
@ -223,6 +229,6 @@ def main():
|
|||
except KeyboardInterrupt:
|
||||
server.shutdown()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -39,7 +39,6 @@ import socket
|
|||
import select
|
||||
import SocketServer
|
||||
import struct
|
||||
import os
|
||||
import logging
|
||||
import getopt
|
||||
import encrypt
|
||||
|
@ -124,13 +123,14 @@ class Socks5Server(SocketServer.StreamRequestHandler):
|
|||
except socket.error, e:
|
||||
logging.warn(e)
|
||||
|
||||
|
||||
def main():
|
||||
global SERVER, PORT, KEY, METHOD, IPv6
|
||||
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format='%(asctime)s %(levelname)-8s %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S', filemode='a+')
|
||||
|
||||
|
||||
version = ''
|
||||
try:
|
||||
import pkg_resources
|
||||
|
@ -142,7 +142,7 @@ def main():
|
|||
KEY = None
|
||||
METHOD = None
|
||||
IPv6 = False
|
||||
|
||||
|
||||
config_path = utils.find_config()
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:p:k:m:c:6')
|
||||
for key, value in optlist:
|
||||
|
@ -154,7 +154,13 @@ def main():
|
|||
config = json.load(f)
|
||||
logging.info('loading config from %s' % config_path)
|
||||
else:
|
||||
config = {}
|
||||
config = {"server": "127.0.0.1",
|
||||
"server_port": 8388,
|
||||
"local_port": 1080,
|
||||
"password": "barfoo!",
|
||||
"timeout": 600,
|
||||
"method": "table"
|
||||
}
|
||||
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:p:k:m:c:6')
|
||||
for key, value in optlist:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue