-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathREADME.md
More file actions
225 lines (159 loc) · 6.35 KB
/
Copy pathREADME.md
File metadata and controls
225 lines (159 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
shadowsocks manyuser branch
===========
Which people need this branch
------------------
1.share shadowsocks server
2.create multi server by shadowsocks
3.manage server (transfer / account)
Install
-------
install MySQL 5.x.x
`pip install cymysql`
create a database named `shadowsocks`
import `shadowsocks.sql` into `shadowsocks`
edit Config.py
Example:
#Config
MYSQL_HOST = 'mdss.mengsky.net'
MYSQL_PORT = 3306
MYSQL_USER = 'ss'
MYSQL_PASS = 'ss'
MYSQL_DB = 'shadowsocks'
MANAGE_PASS = 'ss233333333'
#if you want manage in other server you should set this value to global ip
MANAGE_BIND_IP = '127.0.0.1'
#make sure this port is idle
MANAGE_PORT = 23333
TestRun `cd shadowsocks` ` python server.py`
if no exception server will startup. you will see such like
Example:
db start server at port [%s] pass [%s]
Database user table column
------------------
`passwd` server pass
`port` server port
`t` last keepalive time
`u` upload transfer
`d` download transer
`transfer_enable` if u + d > transfer_enable this server will be stop (db_transfer.py del_server_out_of_bound_safe)
Manage socket
------------------
Manage server work in UDP at `MANAGE_BIND_IP` `MANAGE_PORT`
use `MANAGE_PASS:port:passwd:0` to del a server at port `port`
use `MANAGE_PASS:port:passwd:1` to run a server at port `port` password is `passwd`
Python Eg:
udpsock.sendto('MANAGE_PASS:65535:123456:1', (MANAGE_BIND_IP, MANAGE_PORT))
PHP Eg:
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$msg = 'MANAGE_PASS:65535:123456:1';
$len = strlen($msg);
socket_sendto($sock, $msg, $len, 0, MANAGE_BIND_IP, MANAGE_PORT);
socket_close($sock);
NOTICE
------------------
If error such like `2014-09-18 09:02:37 ERROR [Errno 24] Too many open files`
edit /etc/security/limits.conf
Add:
* soft nofile 8192
* hard nofile 65535
shadowsocks
===========
[![PyPI version]][PyPI] [![Build Status]][Travis CI]
A fast tunnel proxy that helps you bypass firewalls.
[中文说明][Chinese Readme]
Install
-------
You'll have a client on your local machine, and install a server on a
remote server.
### Client
* [Windows] / [OS X]
* [Android] / [iOS]
* [OpenWRT]
### Server
#### Debian / Ubuntu:
apt-get install python-pip python-m2crypto
pip install shadowsocks
Or simply `apt-get install shadowsocks` if you have [Debian sid] in your
source list.
#### CentOS:
yum install m2crypto python-setuptools
easy_install pip
pip install shadowsocks
Configuration
-------------
On your server create a config file `/etc/shadowsocks.json`.
Example:
{
"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,
"workers": 1
}
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 |
Run `ssserver -c /etc/shadowsocks.json` on your server. To run it in the
background, use [Supervisor].
On your client machine, use the same configuration as your server, and
start your client.
If you use Chrome, it's recommended to use [SwitchySharp]. Change the proxy
settings to
protocol: socks5
hostname: 127.0.0.1
port: your local_port
If you can't install [SwitchySharp], 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"
If you can't even download Chrome, find a friend to download a
[Chrome Standalone] installer for you.
Command line args
------------------
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
ssserver -p server_port -k password -m bf-cfb --workers 2
ssserver -c /etc/shadowsocks/config.json
List all available args with `-h`.
Wiki
----
https://github.com/clowwindy/shadowsocks/wiki
License
-------
MIT
Bugs and Issues
----------------
* [Troubleshooting]
* [Issue Tracker]
* [Mailing list]
[Android]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#android
[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
[Chrome Standalone]: https://support.google.com/installer/answer/126299
[Debian sid]: https://packages.debian.org/unstable/python/shadowsocks
[Encryption]: https://github.com/clowwindy/shadowsocks/wiki/Encryption
[iOS]: https://github.com/shadowsocks/shadowsocks-iOS/wiki/Help
[Issue Tracker]: https://github.com/clowwindy/shadowsocks/issues?state=open
[Mailing list]: http://groups.google.com/group/shadowsocks
[OpenWRT]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#openwrt
[OS X]: https://github.com/shadowsocks/shadowsocks-iOS/wiki/Shadowsocks-for-OSX-Help
[PyPI]: https://pypi.python.org/pypi/shadowsocks
[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
[Travis CI]: https://travis-ci.org/clowwindy/shadowsocks
[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