Skip to content

Commit

Permalink
Merge pull request mengskysama#4 from frjalex/patch-1
Browse files Browse the repository at this point in the history
改进了英文语法
  • Loading branch information
mengskysama committed Jan 30, 2015
2 parents 043b2e6 + 29e76d7 commit 3086289
Showing 1 changed file with 37 additions and 32 deletions.
69 changes: 37 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
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
-------
install MySQL 5.x.x
2.For creating multiple servers by shadowsocks

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`

create a database named `shadowsocks`
2. create a database named `shadowsocks`

import `shadowsocks.sql` into `shadowsocks`

edit Config.py
Example:
3. edit the file Config.py:E.g.:

#Config
MYSQL_HOST = 'mdss.mengsky.net'
Expand All @@ -34,60 +36,63 @@ Example:
#make sure this port is idle
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
Example:
If there is no other mistakes, the server will startup automatically. you will see things such as

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)

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`

Python Eg:
E.g.(Python):

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);
$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`


###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

Add:

* soft nofile 8192
* hard nofile 65535

shadowsocks
===========
The Original README File For Shadowsocks
==========================================

[![PyPI version]][PyPI] [![Build Status]][Travis CI]

Expand Down

0 comments on commit 3086289

Please sign in to comment.