From b12ba5383c873bfddf4595276a7fa1c8fd0b2089 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Tue, 6 Jan 2015 19:35:31 +0800 Subject: [PATCH 1/9] Update CONTRIBUTING.md --- CONTRIBUTING.md | 43 ++++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c164423..8abe204 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,38 +1,27 @@ How to contribute ================= -在你提交问题前,请先[自行诊断]一下。提交时附上诊断过程中的问题和下列结果, -否则如果我们无法重现你的问题,也就不能帮助你。 +Pull Requests +------------- -Before you submit issues, please read [Troubleshooting] and take a few minutes -to read this guide. - -问题反馈 -------- - -请提交下面的信息: - -1. 你是如何搭建环境的?(操作系统,Shadowsocks 版本) -2. 操作步骤是什么? -3. 浏览器里的现象是什么?一直转菊花,还是有提示错误? -4. 发生错误时,客户端和服务端最后一部分日志。 -5. 其它你认为可能和问题有关的信息。 - -如果你不清楚其中某条的含义, 可以直接跳过那一条。 +1. Pull requests are welcome. If you would like to add a large feature +or make a significant change, make sure to open an issue to dicuss with +people first. +2. Follow PEP8. +3. Make sure to pass the unit tests. Write unit tests for new modules if +needed. Issues ------ -Please include the following information in your submission: +1. Only bugs and feature requests are accepted here. +2. We'll only work on important features. If the feature you're asking only +benefits a few people, you'd better implement the feature yourself and send us +a pull request, or ask some of your friends to do so. +3. We don't answer questions of any other types here. Since very few people +are watching the issue tracker here, you'll probably get no help from here. +Read [Troubleshooting] and get help from forums or [mailing lists]. -1. How did you set up your environment? (OS, version of Shadowsocks) -2. Steps to reproduce the problem. -3. What happened in your browser? Just no response, or any error message? -4. 10 lines of log on the local side of shadowsocks when the error happened. -5. 10 lines of log on the server side of shadowsocks when the error happened. -6. Any other useful information. - -Skip any of them if you don't know its meaning. [Troubleshooting]: https://github.com/clowwindy/shadowsocks/wiki/Troubleshooting -[自行诊断]: https://github.com/clowwindy/shadowsocks/wiki/Troubleshooting +[mailing lists]: https://groups.google.com/forum/#!forum/shadowsocks From 09f8f1ccc8cd09ad395388fe24edbc55c2a05a41 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Tue, 6 Jan 2015 19:36:34 +0800 Subject: [PATCH 2/9] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8abe204..eb16f6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Pull Requests ------------- 1. Pull requests are welcome. If you would like to add a large feature -or make a significant change, make sure to open an issue to dicuss with +or make a significant change, make sure to open an issue to discuss with people first. 2. Follow PEP8. 3. Make sure to pass the unit tests. Write unit tests for new modules if From ae57ebde68e57155b1fc21a0c4b4e030c0135774 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Tue, 6 Jan 2015 19:39:23 +0800 Subject: [PATCH 3/9] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index bb4ab0d..352addf 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ shadowsocks A fast tunnel proxy that helps you bypass firewalls. -[中文说明][Chinese Readme] - Server ------ @@ -69,7 +67,6 @@ Bugs and Issues [Android]: https://github.com/shadowsocks/shadowsocks/wiki/Ports-and-Clients#android [Build Status]: https://img.shields.io/travis/shadowsocks/shadowsocks/master.svg?style=flat -[Chinese Readme]: https://github.com/shadowsocks/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E [Configuration]: https://github.com/shadowsocks/shadowsocks/wiki/Configuration-via-Config-File [Coverage Status]: https://jenkins.shadowvpn.org/result/shadowsocks [Coverage]: https://jenkins.shadowvpn.org/job/Shadowsocks/ws/htmlcov/index.html From 69d1d876bc0d858dabc4aa1fb4575630d00728e2 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Tue, 6 Jan 2015 19:39:39 +0800 Subject: [PATCH 4/9] Update README.rst --- README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.rst b/README.rst index da9b227..97d1d9f 100644 --- a/README.rst +++ b/README.rst @@ -5,8 +5,6 @@ shadowsocks A fast tunnel proxy that helps you bypass firewalls. -`中文说明 `__ - Install ------- From a90c354f42a4749773f2923ec1bdb1ab10cc15c4 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Tue, 6 Jan 2015 19:41:20 +0800 Subject: [PATCH 5/9] update README --- README.rst | 120 +++++++++++++---------------------------------------- 1 file changed, 28 insertions(+), 92 deletions(-) diff --git a/README.rst b/README.rst index 97d1d9f..510b233 100644 --- a/README.rst +++ b/README.rst @@ -5,24 +5,11 @@ shadowsocks A fast tunnel proxy that helps you bypass firewalls. -Install -------- - -You'll have a client on your local side, and setup a server on a remote -server. - -Client -~~~~~~ - -- `Windows `__ - / `OS - X `__ -- `Android `__ - / `iOS `__ -- `OpenWRT `__ - Server -~~~~~~ +------ + +Install +~~~~~~~ Debian / Ubuntu: ^^^^^^^^^^^^^^^^ @@ -32,107 +19,56 @@ Debian / Ubuntu: apt-get install python-pip pip install shadowsocks -Or simply ``apt-get install shadowsocks`` if you have `Debian -sid `__ in your -source list. - CentOS: ^^^^^^^ :: - yum install python-setuptools - easy_install pip + yum install python-setuptools && easy_install pip pip install shadowsocks Windows: ^^^^^^^^ -Download `OpenSSL for -Windows `__ and install. -Then install shadowsocks via easy\_install and pip as Linux. If you -don't know how to use them, you can directly download `the -package `__, and use -``python shadowsocks/server.py`` instead of ``ssserver`` command below. +See `Install Server on +Windows `__ -Configuration -------------- - -On your server create a config file ``/etc/shadowsocks.json``. Example: +Usage +~~~~~ :: - { - "server":"my_server_ip", - "server_port":8388, - "local_address": "127.0.0.1", - "local_port":1080, - "password":"mypassword", - "timeout":300, - "method":"aes-256-cfb", - "fast_open": false - } - -Explanation of the fields: - -+------------------+-----------------------------------------------------------------------------------------------------------+ -| Name | Explanation | -+==================+===========================================================================================================+ -| server | the address your server listens | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| server\_port | server port | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| local\_address | the address your local listens | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| local\_port | local port | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| password | password used for encryption | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| timeout | in seconds | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| method | default: "aes-256-cfb", see `Encryption `__ | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| fast\_open | use `TCP\_FASTOPEN `__, true / false | -+------------------+-----------------------------------------------------------------------------------------------------------+ -| workers | number of workers, available on Unix/Linux | -+------------------+-----------------------------------------------------------------------------------------------------------+ - -On your server: - -To run in the foreground: - -:: - - ssserver -c /etc/shadowsocks.json + ssserver -p 8000 -k password -m rc4-md5 To run in the background: :: - ssserver -c /etc/shadowsocks.json -d start - ssserver -c /etc/shadowsocks.json -d stop + ssserver -p 8000 -k password -m rc4-md5 -d start + ssserver -p 8000 -k password -m rc4-md5 -d stop -On your client machine, use the same configuration as your server. Check -the README of your client for more information. +Check all the options via ``-h``. You can also use a +`Configuration `__ +file instead. -Command Line Options --------------------- +Client +------ -Check the options via ``-h``.You can use args to override settings from -``config.json``. +- `Windows `__ + / `OS + X `__ +- `Android `__ + / `iOS `__ +- `OpenWRT `__ -:: - - sslocal -s server_name -p server_port -l local_port -k password -m bf-cfb - ssserver -p server_port -k password -m bf-cfb --workers 2 - ssserver -c /etc/shadowsocks/config.json -d start --pid-file=/tmp/shadowsocks.pid - ssserver -c /etc/shadowsocks/config.json -d stop --pid-file=/tmp/shadowsocks.pid +Use GUI clients on your local PC/phones. Check the README of your client +for more information. Documentation ------------- -You can find all the documentation in the wiki: -https://github.com/shadowsocks/shadowsocks/wiki +You can find all the documentation in the +`Wiki `__. License ------- @@ -145,7 +81,7 @@ Bugs and Issues - `Troubleshooting `__ - `Issue Tracker `__ -- `Mailing list `__ +- `Mailing list `__ .. |PyPI version| image:: https://img.shields.io/pypi/v/shadowsocks.svg?style=flat :target: https://pypi.python.org/pypi/shadowsocks From 363965c364709c31afedccb15c9bb924ddb9874e Mon Sep 17 00:00:00 2001 From: clowwindy Date: Tue, 6 Jan 2015 20:13:45 +0800 Subject: [PATCH 6/9] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb16f6c..04aaa02 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -How to contribute +How to Contribute ================= Pull Requests From 4598e09b78cb92fca58eae5f270ecd69d0c61bdd Mon Sep 17 00:00:00 2001 From: clowwindy Date: Wed, 7 Jan 2015 00:24:40 +0800 Subject: [PATCH 7/9] now works on OpenWRT --- shadowsocks/crypto/ctypes_libsodium.py | 5 +++++ shadowsocks/crypto/ctypes_openssl.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/shadowsocks/crypto/ctypes_libsodium.py b/shadowsocks/crypto/ctypes_libsodium.py index 69b9de9..e74d577 100644 --- a/shadowsocks/crypto/ctypes_libsodium.py +++ b/shadowsocks/crypto/ctypes_libsodium.py @@ -42,11 +42,16 @@ def load_libsodium(): global loaded, libsodium, buf from ctypes.util import find_library + libsodium_path = None for p in ('sodium', 'libsodium'): libsodium_path = find_library(p) if libsodium_path: break else: + import glob + for libsodium_path in glob.glob('/usr/lib/libsodium.*'): + pass + if libsodium_path is None: raise Exception('libsodium not found') logging.info('loading libsodium from %s', libsodium_path) libsodium = CDLL(libsodium_path) diff --git a/shadowsocks/crypto/ctypes_openssl.py b/shadowsocks/crypto/ctypes_openssl.py index 0ef8ce0..9e0dfca 100644 --- a/shadowsocks/crypto/ctypes_openssl.py +++ b/shadowsocks/crypto/ctypes_openssl.py @@ -39,11 +39,16 @@ def load_openssl(): global loaded, libcrypto, buf from ctypes.util import find_library + libcrypto_path = None for p in ('crypto', 'eay32', 'libeay32'): libcrypto_path = find_library(p) if libcrypto_path: break else: + import glob + for libcrypto_path in glob.glob('/usr/lib/libcrypto.*'): + pass + if libcrypto_path is None: raise Exception('libcrypto(OpenSSL) not found') logging.info('loading libcrypto from %s', libcrypto_path) libcrypto = CDLL(libcrypto_path) From b6efc0efd900d4a27d3805a0b5fd38aa1105474a Mon Sep 17 00:00:00 2001 From: clowwindy Date: Thu, 8 Jan 2015 04:18:38 +0800 Subject: [PATCH 8/9] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 352addf..7b351ba 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Bugs and Issues * [Mailing list] + [Android]: https://github.com/shadowsocks/shadowsocks/wiki/Ports-and-Clients#android [Build Status]: https://img.shields.io/travis/shadowsocks/shadowsocks/master.svg?style=flat [Configuration]: https://github.com/shadowsocks/shadowsocks/wiki/Configuration-via-Config-File From 8b2deb01d8967cd9afb70600cd0488c5fa34afee Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 8 Jan 2015 11:22:34 +0800 Subject: [PATCH 9/9] Set default method as bytes. Default method as string may cause false error report. --- shadowsocks/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/utils.py b/shadowsocks/utils.py index 475bf10..0247d0f 100644 --- a/shadowsocks/utils.py +++ b/shadowsocks/utils.py @@ -172,7 +172,7 @@ def get_config(is_local): sys.exit(2) config['password'] = config.get('password', '') - config['method'] = config.get('method', 'aes-256-cfb') + config['method'] = config.get('method', b'aes-256-cfb') config['port_password'] = config.get('port_password', None) config['timeout'] = int(config.get('timeout', 300)) config['fast_open'] = config.get('fast_open', False)