add help
This commit is contained in:
parent
3505d4a1c2
commit
ea663145e2
7 changed files with 123 additions and 63 deletions
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
|||
1.3.5 2014-04-07
|
||||
- Add help
|
||||
- Change default local binding address into 127.0.0.1
|
||||
|
||||
1.3.4 2014-02-17
|
||||
- Fix a bug when no config file exists
|
||||
- Client now support multiple server ports and multiple server/port pairs
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
shadowsocks
|
||||
===========
|
||||
|
||||
Current version: 1.3.4 [![Build Status](https://travis-ci.org/clowwindy/shadowsocks.png?branch=master)](https://travis-ci.org/clowwindy/shadowsocks)
|
||||
Current version: 1.3.5 [![Build Status](https://travis-ci.org/clowwindy/shadowsocks.png?branch=master)](https://travis-ci.org/clowwindy/shadowsocks)
|
||||
|
||||
shadowsocks is a lightweight tunnel proxy which can help you get through firewalls.
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -6,7 +6,7 @@ with open('README.rst') as f:
|
|||
|
||||
setup(
|
||||
name = "shadowsocks",
|
||||
version = "1.3.4",
|
||||
version = "1.3.5",
|
||||
license = 'MIT',
|
||||
description = "a lightweight tunnel proxy",
|
||||
author = 'clowwindy',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (c) 2012 clowwindy
|
||||
# Copyright (c) 2014 clowwindy
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (c) 2013 clowwindy
|
||||
# Copyright (c) 2014 clowwindy
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -190,6 +190,7 @@ def main():
|
|||
IPv6 = False
|
||||
|
||||
config_path = utils.find_config()
|
||||
try:
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:b:p:k:l:m:c:6')
|
||||
for key, value in optlist:
|
||||
if key == '-c':
|
||||
|
@ -222,13 +223,16 @@ def main():
|
|||
config['local'] = value
|
||||
elif key == '-6':
|
||||
IPv6 = True
|
||||
except getopt.GetoptError:
|
||||
utils.print_local_help()
|
||||
sys.exit(2)
|
||||
|
||||
SERVER = config['server']
|
||||
REMOTE_PORT = config['server_port']
|
||||
PORT = config['local_port']
|
||||
KEY = config['password']
|
||||
METHOD = config.get('method', None)
|
||||
LOCAL = config.get('local', '')
|
||||
LOCAL = config.get('local', '127.0.0.1')
|
||||
|
||||
if not KEY and not config_path:
|
||||
sys.exit('config not specified, please read https://github.com/clowwindy/shadowsocks')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (c) 2013 clowwindy
|
||||
# Copyright (c) 2014 clowwindy
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -144,6 +144,7 @@ def main():
|
|||
IPv6 = False
|
||||
|
||||
config_path = utils.find_config()
|
||||
try:
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:p:k:m:c:6')
|
||||
for key, value in optlist:
|
||||
if key == '-c':
|
||||
|
@ -173,6 +174,9 @@ def main():
|
|||
config['method'] = value
|
||||
elif key == '-6':
|
||||
IPv6 = True
|
||||
except getopt.GetoptError:
|
||||
utils.print_server_help()
|
||||
sys.exit(2)
|
||||
|
||||
SERVER = config['server']
|
||||
PORT = config['server_port']
|
||||
|
|
|
@ -1,6 +1,26 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2014 clowwindy
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
@ -14,9 +34,37 @@ def find_config():
|
|||
return config_path
|
||||
return None
|
||||
|
||||
|
||||
def check_config(config):
|
||||
if config.get('server', '') in ['127.0.0.1', 'localhost']:
|
||||
logging.warn('Server is set to "%s", maybe it\'s not correct' % config['server'])
|
||||
logging.warn('Notice server will listen at %s:%s' % (config['server'], config['server_port']))
|
||||
if (config.get('method', '') or '').lower() == 'rc4':
|
||||
logging.warn('RC4 is not safe; please use a safer cipher, like AES-256-CFB')
|
||||
|
||||
|
||||
def print_local_help():
|
||||
print '''usage: sslocal [-h] -s SERVER_ADDR -p SERVER_PORT [-b LOCAL_ADDR] -l LOCAL_PORT -k PASSWORD -m METHOD [-c config]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-s SERVER_ADDR server address
|
||||
-p SERVER_PORT server port
|
||||
-b LOCAL_ADDR local binding address, default is 127.0.0.1
|
||||
-s LOCAL_PORT local port
|
||||
-k PASSWORD password
|
||||
-s METHOD encryption method, for example, aes-256-cfb
|
||||
-c CONFIG path to config file
|
||||
'''
|
||||
|
||||
def print_server_help():
|
||||
print '''usage: ssserver [-h] -s SERVER_ADDR -p SERVER_PORT -k PASSWORD -m METHOD [-c config]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-s SERVER_ADDR server address
|
||||
-p SERVER_PORT server port
|
||||
-k PASSWORD password
|
||||
-s METHOD encryption method, for example, aes-256-cfb
|
||||
-c CONFIG path to config file
|
||||
'''
|
Loading…
Reference in a new issue