commit
30862894ce
1 changed files with 37 additions and 32 deletions
69
README.md
69
README.md
|
@ -1,25 +1,27 @@
|
||||||
shadowsocks manyuser branch
|
shadowsocks manyuser branch
|
||||||
===========
|
===========
|
||||||
Which people need this branch
|
|
||||||
------------------
|
|
||||||
1.share shadowsocks server
|
|
||||||
|
|
||||||
2.create multi server by shadowsocks
|
|
||||||
|
|
||||||
3.manage server (transfer / account)
|
###Why This?
|
||||||
|
The shadowsocks manyuser branch implements 3 functions which the original version doesn't have:
|
||||||
|
1.For sharing shadowsocks server
|
||||||
|
|
||||||
Install
|
2.For creating multiple servers by shadowsocks
|
||||||
-------
|
|
||||||
install MySQL 5.x.x
|
3.For managing the servers (transfer / accounting)
|
||||||
|
|
||||||
|
It is ideal for an environment which needs to manage multiple users.
|
||||||
|
|
||||||
|
###Installing
|
||||||
|
1. install MySQL 5.x.x
|
||||||
|
|
||||||
`pip install cymysql`
|
`pip install cymysql`
|
||||||
|
|
||||||
create a database named `shadowsocks`
|
2. create a database named `shadowsocks`
|
||||||
|
|
||||||
import `shadowsocks.sql` into `shadowsocks`
|
import `shadowsocks.sql` into `shadowsocks`
|
||||||
|
|
||||||
edit Config.py
|
3. edit the file Config.py:E.g.:
|
||||||
Example:
|
|
||||||
|
|
||||||
#Config
|
#Config
|
||||||
MYSQL_HOST = 'mdss.mengsky.net'
|
MYSQL_HOST = 'mdss.mengsky.net'
|
||||||
|
@ -34,40 +36,42 @@ Example:
|
||||||
#make sure this port is idle
|
#make sure this port is idle
|
||||||
MANAGE_PORT = 23333
|
MANAGE_PORT = 23333
|
||||||
|
|
||||||
TestRun `cd shadowsocks` ` python server.py`
|
4. Running the first time: `cd shadowsocks` ` python server.py`
|
||||||
|
|
||||||
if no exception server will startup. you will see such like
|
If there is no other mistakes, the server will startup automatically. you will see things such as
|
||||||
Example:
|
|
||||||
|
|
||||||
db start server at port [%s] pass [%s]
|
db start server at port [%s] pass [%s]
|
||||||
|
|
||||||
Database user table column
|
|
||||||
------------------
|
|
||||||
`passwd` server pass
|
|
||||||
|
|
||||||
`port` server port
|
###Database user table columns
|
||||||
|
|
||||||
`t` last keepalive time
|
`passwd` : server pass
|
||||||
|
|
||||||
`u` upload transfer
|
`port` : server port
|
||||||
|
|
||||||
`d` download transer
|
`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)
|
`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`
|
|
||||||
|
###Managing the socket
|
||||||
|
|
||||||
|
The managing server work in UDP at `MANAGE_BIND_IP` `MANAGE_PORT`
|
||||||
|
|
||||||
|
use `MANAGE_PASS:port:passwd:0` to delete a server at port `port`
|
||||||
|
|
||||||
use `MANAGE_PASS:port:passwd:1` to run a server at port `port` password is `passwd`
|
use `MANAGE_PASS:port:passwd:1` to run a server at port `port` password is `passwd`
|
||||||
|
|
||||||
Python Eg:
|
E.g.(Python):
|
||||||
|
|
||||||
udpsock.sendto('MANAGE_PASS:65535:123456:1', (MANAGE_BIND_IP, MANAGE_PORT))
|
udpsock.sendto('MANAGE_PASS:65535:123456:1', (MANAGE_BIND_IP, MANAGE_PORT))
|
||||||
|
|
||||||
PHP Eg:
|
E.g.(PHP):
|
||||||
|
|
||||||
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
||||||
$msg = 'MANAGE_PASS:65535:123456:1';
|
$msg = 'MANAGE_PASS:65535:123456:1';
|
||||||
|
@ -75,10 +79,11 @@ PHP Eg:
|
||||||
socket_sendto($sock, $msg, $len, 0, MANAGE_BIND_IP, MANAGE_PORT);
|
socket_sendto($sock, $msg, $len, 0, MANAGE_BIND_IP, MANAGE_PORT);
|
||||||
socket_close($sock);
|
socket_close($sock);
|
||||||
|
|
||||||
NOTICE
|
|
||||||
------------------
|
|
||||||
If error such like `2014-09-18 09:02:37 ERROR [Errno 24] Too many open files`
|
|
||||||
|
|
||||||
|
|
||||||
|
###Noticements
|
||||||
|
If an error occurs such as `2014-09-18 09:02:37 ERROR [Errno 24] Too many open files` ,
|
||||||
|
The solution is:
|
||||||
edit /etc/security/limits.conf
|
edit /etc/security/limits.conf
|
||||||
|
|
||||||
Add:
|
Add:
|
||||||
|
@ -86,8 +91,8 @@ Add:
|
||||||
* soft nofile 8192
|
* soft nofile 8192
|
||||||
* hard nofile 65535
|
* hard nofile 65535
|
||||||
|
|
||||||
shadowsocks
|
The Original README File For Shadowsocks
|
||||||
===========
|
==========================================
|
||||||
|
|
||||||
[![PyPI version]][PyPI] [![Build Status]][Travis CI]
|
[![PyPI version]][PyPI] [![Build Status]][Travis CI]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue