Browse Source

refine documentation

auth
clowwindy 10 years ago
parent
commit
35c3b0b41c
  1. 43
      README.md
  2. 52
      README.rst
  3. 2
      shadowsocks/daemon.py

43
README.md

@ -56,8 +56,7 @@ Example:
"password":"mypassword", "password":"mypassword",
"timeout":300, "timeout":300,
"method":"aes-256-cfb", "method":"aes-256-cfb",
"fast_open": false, "fast_open": false
"workers": 1
} }
Explanation of the fields: Explanation of the fields:
@ -74,40 +73,35 @@ Explanation of the fields:
| fast_open | use [TCP_FASTOPEN], true / false | | fast_open | use [TCP_FASTOPEN], true / false |
| workers | number of workers, available on Unix/Linux | | workers | number of workers, available on Unix/Linux |
Run `ssserver -c /etc/shadowsocks.json` on your server. To run it in the On your server:
background, use [Supervisor].
On your client machine, use the same configuration as your server, and To run in the foreground:
start your client.
If you use Chrome, it's recommended to use [SwitchySharp]. Change the proxy ssserver -c /etc/shadowsocks.json
settings to
protocol: socks5 To run in the background:
hostname: 127.0.0.1
port: your local_port
If you can't install [SwitchySharp], you can launch Chrome with the following sudo ssserver -c /etc/shadowsocks.json -d start
arguments to force Chrome to use the proxy: sudo ssserver -c /etc/shadowsocks.json -d stop
Chrome.exe --proxy-server="socks5://127.0.0.1:1080" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" On your client machine, use the same configuration as your server. Check the
README of your client for more information.
If you can't even download Chrome, find a friend to download a Command Line Options
[Chrome Standalone] installer for you. --------------------
Command line args Check the options via `-h`.You can use args to override settings from
------------------ `config.json`.
You can use args to override settings from `config.json`.
sslocal -s server_name -p server_port -l local_port -k password -m bf-cfb 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 -p server_port -k password -m bf-cfb --workers 2
ssserver -c /etc/shadowsocks/config.json 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
List all available args with `-h`. List all available args with `-h`.
Wiki Documentation
---- -------------
You can find all the documentation in the wiki: You can find all the documentation in the wiki:
https://github.com/clowwindy/shadowsocks/wiki https://github.com/clowwindy/shadowsocks/wiki
@ -127,7 +121,6 @@ Bugs and Issues
[Android]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#android [Android]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#android
[Build Status]: https://img.shields.io/travis/clowwindy/shadowsocks/master.svg?style=flat [Build Status]: https://img.shields.io/travis/clowwindy/shadowsocks/master.svg?style=flat
[Chinese Readme]: https://github.com/clowwindy/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E [Chinese Readme]: https://github.com/clowwindy/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
[Chrome Standalone]: https://support.google.com/installer/answer/126299
[Debian sid]: https://packages.debian.org/unstable/python/shadowsocks [Debian sid]: https://packages.debian.org/unstable/python/shadowsocks
[the package]: https://pypi.python.org/pypi/shadowsocks [the package]: https://pypi.python.org/pypi/shadowsocks
[Encryption]: https://github.com/clowwindy/shadowsocks/wiki/Encryption [Encryption]: https://github.com/clowwindy/shadowsocks/wiki/Encryption
@ -139,9 +132,7 @@ Bugs and Issues
[OS X]: https://github.com/shadowsocks/shadowsocks-iOS/wiki/Shadowsocks-for-OSX-Help [OS X]: https://github.com/shadowsocks/shadowsocks-iOS/wiki/Shadowsocks-for-OSX-Help
[PyPI]: https://pypi.python.org/pypi/shadowsocks [PyPI]: https://pypi.python.org/pypi/shadowsocks
[PyPI version]: https://img.shields.io/pypi/v/shadowsocks.svg?style=flat [PyPI version]: https://img.shields.io/pypi/v/shadowsocks.svg?style=flat
[Supervisor]: https://github.com/clowwindy/shadowsocks/wiki/Configure-Shadowsocks-with-Supervisor
[TCP_FASTOPEN]: https://github.com/clowwindy/shadowsocks/wiki/TCP-Fast-Open [TCP_FASTOPEN]: https://github.com/clowwindy/shadowsocks/wiki/TCP-Fast-Open
[Travis CI]: https://travis-ci.org/clowwindy/shadowsocks [Travis CI]: https://travis-ci.org/clowwindy/shadowsocks
[Troubleshooting]: https://github.com/clowwindy/shadowsocks/wiki/Troubleshooting [Troubleshooting]: https://github.com/clowwindy/shadowsocks/wiki/Troubleshooting
[SwitchySharp]: https://chrome.google.com/webstore/detail/proxy-switchysharp/dpplabbmogkhghncfbfdeeokoefdjegm
[Windows]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#windows [Windows]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#windows

52
README.rst

@ -50,9 +50,10 @@ CentOS:
Windows: Windows:
^^^^^^^^ ^^^^^^^^
Download OpenSSL for Windows and install. Then install shadowsocks via Download `OpenSSL for
easy\_install and pip as Linux. If you don't know how to use them, you Windows <http://slproweb.com/products/Win32OpenSSL.html>`__ and install.
can directly download `the 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 <https://pypi.python.org/pypi/shadowsocks>`__, and use package <https://pypi.python.org/pypi/shadowsocks>`__, and use
``python shadowsocks/server.py`` instead of ``ssserver`` command below. ``python shadowsocks/server.py`` instead of ``ssserver`` command below.
@ -71,8 +72,7 @@ On your server create a config file ``/etc/shadowsocks.json``. Example:
"password":"mypassword", "password":"mypassword",
"timeout":300, "timeout":300,
"method":"aes-256-cfb", "method":"aes-256-cfb",
"fast_open": false, "fast_open": false
"workers": 1
} }
Explanation of the fields: Explanation of the fields:
@ -99,51 +99,41 @@ Explanation of the fields:
| workers | number of workers, available on Unix/Linux | | workers | number of workers, available on Unix/Linux |
+------------------+---------------------------------------------------------------------------------------------------------+ +------------------+---------------------------------------------------------------------------------------------------------+
Run ``ssserver -c /etc/shadowsocks.json`` on your server. To run it in On your server:
the background, use
`Supervisor <https://github.com/clowwindy/shadowsocks/wiki/Configure-Shadowsocks-with-Supervisor>`__.
On your client machine, use the same configuration as your server, and To run in the foreground:
start your client.
If you use Chrome, it's recommended to use
`SwitchySharp <https://chrome.google.com/webstore/detail/proxy-switchysharp/dpplabbmogkhghncfbfdeeokoefdjegm>`__.
Change the proxy settings to
:: ::
protocol: socks5 ssserver -c /etc/shadowsocks.json
hostname: 127.0.0.1
port: your local_port
If you can't install To run in the background:
`SwitchySharp <https://chrome.google.com/webstore/detail/proxy-switchysharp/dpplabbmogkhghncfbfdeeokoefdjegm>`__,
you can launch Chrome with the following arguments to force Chrome to
use the proxy:
:: ::
Chrome.exe --proxy-server="socks5://127.0.0.1:1080" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" sudo ssserver -c /etc/shadowsocks.json -d start
sudo ssserver -c /etc/shadowsocks.json -d stop
If you can't even download Chrome, find a friend to download a `Chrome On your client machine, use the same configuration as your server. Check
Standalone <https://support.google.com/installer/answer/126299>`__ the README of your client for more information.
installer for you.
Command line args Command Line Options
----------------- --------------------
You can use args to override settings from ``config.json``. Check the options via ``-h``.You can use args to override settings from
``config.json``.
:: ::
sslocal -s server_name -p server_port -l local_port -k password -m bf-cfb 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 -p server_port -k password -m bf-cfb --workers 2
ssserver -c /etc/shadowsocks/config.json ssserver -c /etc/shadowsocks/config.json -d start --pid-file=/tmp/pid
ssserver -c /etc/shadowsocks/config.json -d stop --pid-file=/tmp/pid
List all available args with ``-h``. List all available args with ``-h``.
Wiki Documentation
---- -------------
You can find all the documentation in the wiki: You can find all the documentation in the wiki:
https://github.com/clowwindy/shadowsocks/wiki https://github.com/clowwindy/shadowsocks/wiki

2
shadowsocks/daemon.py

@ -37,7 +37,7 @@ from shadowsocks import common
def daemon_exec(config): def daemon_exec(config):
if 'daemon' in config: if 'daemon' in config:
if os.name != 'posix': if os.name != 'posix':
raise Exception('daemon mode is only supported in unix') raise Exception('daemon mode is only supported on Unix')
command = config['daemon'] command = config['daemon']
if not command: if not command:
command = 'start' command = 'start'

Loading…
Cancel
Save