Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #3 from KeJunMao/patch-1 #44

Open
wants to merge 502 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
502 commits
Select commit Hold shift + click to select a range
9c80dee
fix traffic & uptime
breakwa11 Jul 21, 2016
c3484b3
fix uptime
breakwa11 Jul 21, 2016
0a7d71a
using mysql.json to config mysql
breakwa11 Jul 21, 2016
a616249
read traffic_rate from ss_node
breakwa11 Jul 21, 2016
0ed10c7
remove dup close
breakwa11 Jul 24, 2016
b922d70
set pull flag
breakwa11 Jul 24, 2016
2c4600c
fix get node_id
breakwa11 Jul 24, 2016
3525d3d
fix get node_id
breakwa11 Jul 24, 2016
a440a72
fix get node_id
breakwa11 Jul 24, 2016
0213e78
log listening port, remove `auth_simple`, redirect the same port
breakwa11 Jul 27, 2016
f0d6a5b
log listening port over UDP
breakwa11 Jul 27, 2016
1121434
add shadowsocks.obfsplugin to setup.py for distribution
ufbycd Jul 28, 2016
82df452
fix host_list type
breakwa11 Jul 28, 2016
ca41f18
Merge pull request #103 from ufbycd/manyuser
breakwa11 Jul 29, 2016
4a291ff
add keep alive setting
breakwa11 Jul 29, 2016
9b314af
Merge branch 'manyuser' of git@breakwa11:breakwa11/shadowsocks.git in…
breakwa11 Jul 29, 2016
25e9c13
change err return
breakwa11 Jul 29, 2016
8da3bdc
set KEEPALIVE except windows
breakwa11 Jul 30, 2016
f14461e
replace("=", "")
breakwa11 Jul 30, 2016
292865f
Linux only
breakwa11 Jul 30, 2016
e15030c
set KEEPIDLE on windows/mac osx
breakwa11 Aug 1, 2016
f3808a3
random choice a host name (http_simple/http_post/tls1.2_ticket_auth)
breakwa11 Aug 1, 2016
d47905f
fix name
breakwa11 Aug 1, 2016
b1aade8
remove custom obfs_param & protocol_param
breakwa11 Aug 6, 2016
3ce6e6f
fix transfer update
breakwa11 Aug 13, 2016
816d2f6
remove tls_simple, fix tls1.2_ticket_auth
breakwa11 Aug 15, 2016
a26019f
fix online users
breakwa11 Aug 15, 2016
f989fd4
fix error return
breakwa11 Aug 16, 2016
efea3e0
fix error return
breakwa11 Aug 16, 2016
1e24450
remove keep alive
breakwa11 Aug 18, 2016
e1aa680
log if no user
breakwa11 Aug 20, 2016
b3fcee6
fix unit_len in auth_sha1
breakwa11 Aug 20, 2016
5e485eb
warn if incorrect node id
breakwa11 Aug 21, 2016
6ee4eb3
set default node id to 0 and default db to "sspanel"
breakwa11 Aug 21, 2016
6c34c41
fix verify_sha1 response
breakwa11 Aug 22, 2016
3d4356e
fix verify_sha1 redirect
breakwa11 Aug 22, 2016
1221a1f
log RLIMIT_NOFILE
breakwa11 Aug 24, 2016
1fe6e89
fix log RLIMIT_NOFILE
breakwa11 Aug 24, 2016
e81f8db
add auth_sha1_v3, remove tls1.0_session_auth
breakwa11 Aug 31, 2016
88017d9
fix ssl connection
breakwa11 Sep 4, 2016
2637c8d
fix chacha20-ietf
breakwa11 Sep 4, 2016
a02e995
fix bug at KqueueLoop close (#117)
18o Sep 16, 2016
933e75b
add auth_sha1_v4
breakwa11 Sep 20, 2016
5204138
fix push_db_all_user
breakwa11 Sep 21, 2016
a407bcc
add auth_aes128
breakwa11 Sep 22, 2016
e7db6d4
fix typo
breakwa11 Sep 26, 2016
ada4eab
sendback an empty packet if auth success
breakwa11 Sep 30, 2016
574a10a
fix bugs in auth_aes128 when run as a client
breakwa11 Oct 1, 2016
e8f6d87
add user key, add HMAC-MD5
breakwa11 Oct 2, 2016
293a937
wait extra data
breakwa11 Oct 3, 2016
1183d56
server can limit the host setting
breakwa11 Oct 4, 2016
d1f64de
-P => -O
breakwa11 Oct 8, 2016
c48190f
sort key, refine log
breakwa11 Oct 11, 2016
45e27f9
display version
breakwa11 Oct 11, 2016
249b7fd
fix path
breakwa11 Oct 11, 2016
5345c66
add License
breakwa11 Oct 11, 2016
b8afd21
bump 2.9.5
breakwa11 Oct 12, 2016
a0ee80a
new default config
breakwa11 Oct 14, 2016
685b625
2.9.5.1
breakwa11 Oct 16, 2016
cfb8944
tls1.2_ticket_auth random packet size
breakwa11 Oct 17, 2016
2eaca2f
fix typo
breakwa11 Oct 17, 2016
13ffdac
tls1.2 split pack data
breakwa11 Oct 18, 2016
e5824be
fix none encrypt key size
breakwa11 Oct 24, 2016
c7fb9bc
init script & update README.md
breakwa11 Oct 28, 2016
9533044
update init script
breakwa11 Oct 28, 2016
ac58020
print RLIMIT_NOFILE
breakwa11 Nov 2, 2016
2a6fbc8
fix import error of resource on windows
V-E-O Nov 10, 2016
0b94af0
Merge pull request #130 from V-E-O/patch-1
breakwa11 Nov 10, 2016
ce25bbf
catch bind error
breakwa11 Nov 21, 2016
c3a9612
bump 2.9.7
breakwa11 Nov 22, 2016
d45ba8d
OpenSSL 1.1.0 compatible
breakwa11 Nov 22, 2016
e048e22
Do not return empty list if raise exception
breakwa11 Nov 24, 2016
bdee67b
create a Dockerfile for ssr (#143)
shoaly Dec 18, 2016
e0b4bdf
refine obfs, support comment in config.json
breakwa11 Dec 23, 2016
b513210
fix tls
breakwa11 Dec 23, 2016
403ce5d
bump
breakwa11 Dec 23, 2016
c7815a0
Support redirect rule (#145)
glzjin Dec 24, 2016
5bd61e1
refine redirect (#147)
glzjin Dec 27, 2016
3498212
force pack some data in url
breakwa11 Dec 29, 2016
9dfcfe0
remove all compatible
breakwa11 Dec 29, 2016
19d0034
update README
orvice Dec 29, 2016
486c007
change default protocol settings, refine auth_aes128_* for redir method
breakwa11 Dec 30, 2016
e63d1ea
auth_sha1 & auth_sha1_v2 keep compatible, remove auth_sha1_v3
breakwa11 Dec 31, 2016
33862fa
remove auth_sha1_v3
breakwa11 Dec 31, 2016
5ae0c67
add auth_sha1_v4_compatible
breakwa11 Jan 1, 2017
77155a5
bump
breakwa11 Jan 3, 2017
7c6d059
change default protocol to auth_aes128_md5
breakwa11 Jan 3, 2017
22ce739
update readme
breakwa11 Jan 4, 2017
959aad3
multiuser in single port protocol
breakwa11 Jan 4, 2017
0ca45be
update MU auth_aes128_* protocol
breakwa11 Jan 6, 2017
b367ad0
using '#' to split multi-user setting
breakwa11 Jan 6, 2017
fd9214b
Use space instead of tab for indent
Noisyfox Jan 7, 2017
84fd119
Fix mujson_mgr.py crash on windows
Noisyfox Jan 7, 2017
490ae12
Fix mujson_mgr.py crash when MUDB_FILE doesn't exist
Noisyfox Jan 7, 2017
498f71a
Save json config as utf8
Noisyfox Jan 7, 2017
0f8dd36
Add initcfg.bat for windows
Noisyfox Jan 7, 2017
0bf1e46
Update .gitignore
Noisyfox Jan 7, 2017
f05bea4
Fix crash on windows
Noisyfox Jan 7, 2017
8777152
Run db thread as daemon
Noisyfox Jan 7, 2017
6d53546
Use super() call
Noisyfox Jan 7, 2017
f0b0a31
Revert commit fd9214b3343051a0c0c16d3d5d8d30c432dc8590
Noisyfox Jan 7, 2017
e6410c0
Don't clear file first when saving config file
Noisyfox Jan 7, 2017
cd825c9
typo
breakwa11 Jan 7, 2017
4f52dff
parse protocol_param in py3
breakwa11 Jan 7, 2017
de67c11
typo
breakwa11 Jan 7, 2017
25c66da
bump
breakwa11 Jan 8, 2017
278ce30
update mu online client manager
breakwa11 Jan 9, 2017
588d8ad
fix auth_aes128_* client side
breakwa11 Jan 11, 2017
2de2a55
multi-user for mudbjson mode
breakwa11 Jan 11, 2017
ad892e1
let 'transfer_enable' be an integer
breakwa11 Jan 11, 2017
d4b7483
modify mgr fast command
breakwa11 Jan 12, 2017
4048aba
refine user transfer
breakwa11 Jan 13, 2017
7564363
change default setting
breakwa11 Jan 15, 2017
ccacef1
fix bug & update usage
breakwa11 Jan 17, 2017
9c79462
fix auth_aes128_* client side
breakwa11 Jan 18, 2017
7cfbe49
refine traffic log when redirect enable (#163)
esdeathlove Jan 18, 2017
68693d5
fix bug under py3
breakwa11 Jan 21, 2017
00a3128
encode protocol param to URL with -i
breakwa11 Jan 22, 2017
96760ed
not display RST error
breakwa11 Jan 23, 2017
e7a61a9
ignore SIGPIPE
breakwa11 Jan 24, 2017
390be3b
random ticket size for client only
breakwa11 Feb 2, 2017
31aaea6
add "glzjinmod" interface
breakwa11 Feb 2, 2017
bf443d7
refine add "glzjinmod" interface
esdeathlove Feb 4, 2017
3014b00
Update README.md (#169)
dwwwwww Feb 5, 2017
26b4d8b
Merge branch manyuser into dev
breakwa11 Feb 5, 2017
5d47908
fix tls1.2_ticket_auth when it as a client
breakwa11 Feb 5, 2017
bf8bb8a
fix undefined variable bug (#171)
18o Feb 5, 2017
2750af4
optimize shell (#173)
18o Feb 11, 2017
72ca31d
add traffic control for each TCP connection
breakwa11 Feb 12, 2017
85955d6
speed limit in KiB
breakwa11 Feb 12, 2017
2723295
fix CPU usage
breakwa11 Feb 12, 2017
6732244
lower latency
breakwa11 Feb 12, 2017
74083af
process DNS
breakwa11 Feb 13, 2017
c4c1cd6
refine auth_aes128_* & http_*
breakwa11 Feb 14, 2017
f296751
bandwidth limit of the user
breakwa11 Feb 14, 2017
e2957e6
timeout set to 1
breakwa11 Feb 14, 2017
e1b199f
add additional_ports in config
breakwa11 Feb 19, 2017
bae7d7a
fix str type under py3
breakwa11 Mar 2, 2017
1355c27
remove bom
breakwa11 Mar 15, 2017
e3d6efb
bump
breakwa11 Mar 15, 2017
e19f9e7
add "New session ticket"
breakwa11 Mar 18, 2017
6f35105
fix syntax
breakwa11 Mar 18, 2017
caaacc7
accept any size of Finish message
breakwa11 Mar 18, 2017
6712dd6
fix accept any size of Finish message
breakwa11 Mar 18, 2017
1c58b10
ignore bind 10.0.0.0/8 and 192.168.0.0/16
breakwa11 Mar 19, 2017
63a6de5
fix host type in http_simple
breakwa11 Mar 23, 2017
bf0055b
fix Dockerfile
breakwa11 Mar 23, 2017
6cbcd85
better rand size
breakwa11 Mar 24, 2017
1b1c1fb
improve rand size
breakwa11 Mar 24, 2017
63cceb2
fix Dockerfile
breakwa11 Mar 24, 2017
76fd429
bump
breakwa11 Mar 24, 2017
922cf46
improve rand
breakwa11 Mar 25, 2017
90ffd1c
display UID
breakwa11 Mar 26, 2017
4d9fca9
display UID
breakwa11 Mar 26, 2017
8e27035
fix buffer_size
breakwa11 Mar 26, 2017
d82c931
auto adjust TCP_MAXSEG
breakwa11 Apr 5, 2017
862fa89
typo
breakwa11 Apr 5, 2017
51c8ae4
bump
breakwa11 Apr 7, 2017
a3a8ed9
fix a mistake
breakwa11 Apr 8, 2017
2b64802
fix data length range
breakwa11 Apr 9, 2017
1e7e707
set MSS up to 1500
breakwa11 Apr 9, 2017
036df8a
Use thread.join() instead (#219)
handyman4hire Apr 14, 2017
7deba0b
remove auth_aes128, fix bugs
breakwa11 Apr 22, 2017
db6629a
test new protocol
breakwa11 Apr 22, 2017
774134f
remove auth_sha1, auth_sha1_v2, verify_simple, auth_simple, verify_sha1
breakwa11 Apr 25, 2017
caadb60
impl auth_chain client
breakwa11 Apr 25, 2017
73af0ee
fix auth_chain_a
breakwa11 Apr 25, 2017
8322cd9
bump
breakwa11 Apr 27, 2017
582d7b7
connect_log include local addr & port
breakwa11 Apr 27, 2017
5896eac
fix auth_chain_a UDP bug
breakwa11 Apr 28, 2017
f3a3ab4
log UDP bind port
breakwa11 Apr 28, 2017
f5f4bd0
force tcp_mss in range (500, 1500]
breakwa11 Apr 28, 2017
3c308ca
force additional ports only with ss-panel (#218)
satouriko Apr 29, 2017
c3bb64b
add interface legendsockssr
breakwa11 Apr 30, 2017
1e85d14
optimize
breakwa11 Apr 30, 2017
03b1a53
run with newest python version
breakwa11 May 2, 2017
d968f01
parse comment
breakwa11 May 4, 2017
0969937
fix bytes type
breakwa11 May 4, 2017
2388802
fix run script
breakwa11 May 4, 2017
5cb9445
chmod +x
breakwa11 May 4, 2017
26f360c
update mgr
breakwa11 May 7, 2017
8aa3fcd
add cymysql setup script
breakwa11 May 8, 2017
7599e53
more log for debug
breakwa11 May 9, 2017
45faa93
close unknown socket
breakwa11 May 9, 2017
be69655
new speed tester
breakwa11 May 9, 2017
a1f56d1
refine log
breakwa11 May 10, 2017
5e14119
removefd
breakwa11 May 10, 2017
19e2e74
fd instead
breakwa11 May 10, 2017
709e67a
bump
breakwa11 May 11, 2017
6c162b1
fix stop script
breakwa11 May 12, 2017
abe4ac3
Async DNS query under UDP
breakwa11 May 12, 2017
c1f1281
let py2 works
breakwa11 May 12, 2017
67065a2
chmod +x
breakwa11 May 12, 2017
96200d7
fix key size
breakwa11 May 14, 2017
85b6930
fix old version of OpenSSL
breakwa11 May 17, 2017
d6e1f73
fix old version of OpenSSL
breakwa11 May 17, 2017
1dc6c4b
http reply
breakwa11 May 18, 2017
6e3fdd0
bump
breakwa11 May 18, 2017
7a68e4e
more reply addr
breakwa11 May 18, 2017
86de572
revert http reply
breakwa11 May 18, 2017
24623b8
fix str type
breakwa11 May 20, 2017
3b02005
refine error detector
breakwa11 May 20, 2017
542a2e6
bump 3.3.2
breakwa11 May 20, 2017
77628ac
allow fast sending request
breakwa11 May 20, 2017
c1364c3
init user_id
breakwa11 May 27, 2017
587453c
fix overhead size
breakwa11 May 27, 2017
a3315bc
Revert "fix overhead size"
breakwa11 May 28, 2017
92722c2
refine _get_read_size
breakwa11 May 29, 2017
f31a816
refine UDP over TCP
breakwa11 May 30, 2017
b89931f
fix cmp in Python 3
breakwa11 May 31, 2017
2cf5f19
add DNS cache
breakwa11 May 31, 2017
280c762
add tls1.2_ticket_fastauth
breakwa11 Jun 3, 2017
7c3d4e0
bump 3.3.3
breakwa11 Jun 3, 2017
8826f51
fix async DNS
breakwa11 Jun 3, 2017
47c6e16
fix a mem leak
breakwa11 Jun 3, 2017
f22ef99
do not destroy
breakwa11 Jun 3, 2017
82f8fef
allow set speed limit in runtime
breakwa11 Jun 4, 2017
44185c9
fix KeyError
breakwa11 Jun 5, 2017
71625e6
refine Dockerfile
breakwa11 Jun 16, 2017
b655222
fix http_post under py3
breakwa11 Jun 16, 2017
7b62f9f
fix http_post under py3
breakwa11 Jun 16, 2017
0e045a3
fix http_post under py3
breakwa11 Jun 16, 2017
f6752fb
refine Dockerfile
breakwa11 Jun 16, 2017
19c8682
update mujson_mgr.py usage info
breakwa11 Jun 18, 2017
d8d19a9
better
muicoder Jun 19, 2017
0d40a52
Merge pull request #253 from muicoder/patch-1
breakwa11 Jun 20, 2017
7c6c671
default work at "~"
breakwa11 Jun 22, 2017
adbaafa
fix default work
muicoder Jun 22, 2017
727d218
fix var name
breakwa11 Jun 22, 2017
57ba4f5
add initmudbjson.sh
breakwa11 Jun 28, 2017
e21f017
update initmudbjson.sh
breakwa11 Jun 28, 2017
ab87651
update initmudbjson.sh
breakwa11 Jun 28, 2017
1a2c7ed
update initmudbjson.sh
breakwa11 Jun 28, 2017
bc93003
update initmudbjson.sh
breakwa11 Jun 28, 2017
a629d1b
update initmudbjson.sh
breakwa11 Jun 28, 2017
339c1cc
fix connections ref
breakwa11 Jul 3, 2017
0c1a936
fix initmudbjson.sh, remove LRUCache init log
breakwa11 Jul 12, 2017
4198ec8
not filter mu port
breakwa11 Jul 16, 2017
ab236ff
fix compatible of tls1.2_ticket_fastauth
breakwa11 Jul 25, 2017
38ef6a2
add auth_chain_b
breakwa11 Jul 25, 2017
838caa3
fix overhead
breakwa11 Jul 26, 2017
7dddf07
fix overhead
breakwa11 Jul 26, 2017
cb1dcac
refine recv size
breakwa11 Jul 26, 2017
604cbf8
more small packet
breakwa11 Jul 26, 2017
e8b4bb0
adjust
breakwa11 Jul 27, 2017
e3ec6bb
adjust
breakwa11 Jul 27, 2017
b3cf97c
adjust
breakwa11 Jul 27, 2017
fd723a9
bump
breakwa11 Jul 27, 2017
97f71a5
fix Docker file wget url
KeJunMao Aug 18, 2017
52a69e7
Merge pull request #3 from KeJunMao/patch-1
shadowsocksr-backup-release Aug 18, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ htmlcov

.DS_Store
.idea

# Ignore user config
user-config.json
userapiconfig.py
usermysql.json
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ before_install:
- sudo dd if=/dev/urandom of=/usr/share/nginx/www/file bs=1M count=10
- sudo sh -c "echo '127.0.0.1 localhost' > /etc/hosts"
- sudo service nginx restart
- pip install pep8 pyflakes nose coverage
- pip install pep8 pyflakes nose coverage PySocks cymysql
- sudo tests/socksify/install.sh
- sudo tests/libsodium/install.sh
- sudo tests/setup_tc.sh
Expand Down
101 changes: 101 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,104 @@
3.4.0 2017-07-27
- add auth_chain_b
- add initmudbjson.sh
- allow set speed limit in runtime
- fix bugs & mem leak

3.3.3 2017-06-03
- add DNS cache
- add tls1.2_ticket_fastauth
- fix bugs

3.3.2 2017-05-20
- revert http reply
- refine tls1.2_ticket_auth error detector

3.3.1 2017-05-18
- fix stop script
- Async DNS query under UDP
- fix old version of OpenSSL
- http reply

3.3.0 2017-05-11
- connect_log include local addr & port
- fix auth_chain_a UDP bug
- add "additional_ports_only"
- add interface legendsockssr
- run with newest python version
- parse comment in hosts
- update mujson_mgr
- add cymysql setup script
- new speed tester
- fix leaks
- bugs fixed

3.2.0 2017-04-27
- add auth_chain_a
- remove auth_aes128, auth_sha1, auth_sha1_v2, verify_simple, auth_simple, verify_sha1

3.1.2 2017-04-07
- display UID
- auto adjust TCP MSS

3.1.1 2017-03-25
- add "New session ticket"
- ignore bind 10.0.0.0/8 and 192.168.0.0/16 by default
- improve rand size under auth_aes128_*
- fix bugs

3.1.0 2017-03-16
- add "glzjinmod" interface
- rate limit
- add additional_ports in config

3.0.4 2017-01-08
- multi-user in single port

3.0.1 2017-01-03
- remove auth_aes128_*_compatible

3.0.0 2016-12-23
- http_simple fix bugs
- tls1.2_ticket_auth fix bug & defaule time diff set to 86400s

2.9.7 2016-11-22
- manage client with LRUCache
- catch bind error
- fix import error of resource on windows
- print RLIMIT_NOFILE
- always close cymysql objects
- add init script

2.9.6 2016-10-17
- tls1.2_ticket_auth random packet size

2.9.5.1 2016-10-16
- UDP bind address

2.9.5 2016-10-13
- add auth_aes128_md5 and auth_aes128_sha1

2.9.4 2016-10-11
- sync client version

2.6.13 2015-11-02
- add protocol setting

2.6.12 2015-10-27
- IPv6 first
- Fix mem leaks
- auth_simple plugin
- remove FORCE_NEW_PROTOCOL
- optimize code

2.6.11 2015-10-20
- Obfs plugin
- Obfs parameters
- UDP over TCP
- TCP over UDP (experimental)
- Fix socket leaks
- Catch abnormal UDP package

2.6.10 2015-06-08
- Optimize LRU cache
- Refine logging
Expand Down
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM alpine:3.6

ENV SERVER_ADDR 0.0.0.0
ENV SERVER_PORT 51348
ENV PASSWORD psw
ENV METHOD aes-128-ctr
ENV PROTOCOL auth_aes128_md5
ENV PROTOCOLPARAM 32
ENV OBFS tls1.2_ticket_auth_compatible
ENV TIMEOUT 300
ENV DNS_ADDR 8.8.8.8
ENV DNS_ADDR_2 8.8.4.4

ARG BRANCH=manyuser
ARG WORK=~


RUN apk --no-cache add python \
libsodium \
wget


RUN mkdir -p $WORK && \
wget -qO- --no-check-certificate https://github.com/shadowsocksr-backup/shadowsocksr/archive/$BRANCH.tar.gz | tar -xzf - -C $WORK


WORKDIR $WORK/shadowsocksr-$BRANCH/shadowsocks


EXPOSE $SERVER_PORT
CMD python server.py -p $SERVER_PORT -k $PASSWORD -m $METHOD -O $PROTOCOL -o $OBFS -G $PROTOCOLPARAM
67 changes: 33 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
shadowsocks
ShadowsocksR
===========

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

A fast tunnel proxy that helps you bypass firewalls.

Expand All @@ -14,41 +12,52 @@ Server

Debian / Ubuntu:

apt-get install python-pip
pip install shadowsocks
apt-get install git
git clone https://github.com/shadowsocksr/shadowsocksr.git

CentOS:

yum install python-setuptools && easy_install pip
pip install shadowsocks
yum install git
git clone https://github.com/shadowsocksr/shadowsocksr.git

Windows:

See [Install Server on Windows]
git clone https://github.com/shadowsocksr/shadowsocksr.git

### Usage
### Usage for single user on linux platform

ssserver -p 443 -k password -m aes-256-cfb
If you clone it into "~/shadowsocksr"
move to "~/shadowsocksr", then run:

bash initcfg.sh

move to "~/shadowsocksr/shadowsocks", then run:

python server.py -p 443 -k password -m aes-128-cfb -O auth_aes128_md5 -o tls1.2_ticket_auth_compatible

Check all the options via `-h`.

You can also use a configuration file instead (recommend), move to "~/shadowsocksr" and edit the file "user-config.json", then move to "~/shadowsocksr/shadowsocks" again, just run:

python server.py

To run in the background:

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
./logrun.sh

To stop:

sudo ssserver -d stop
./stop.sh

To check the log:
To monitor the log:

sudo less /var/log/shadowsocks.log
./tail.sh

Check all the options via `-h`. You can also use a [Configuration] file
instead.

Client
------

* [Windows] / [OS X]
* [Windows] / [macOS]
* [Android] / [iOS]
* [OpenWRT]

Expand Down Expand Up @@ -80,27 +89,17 @@ under the License.
Bugs and Issues
----------------

* [Troubleshooting]
* [Issue Tracker]
* [Mailing list]



[Android]: https://github.com/shadowsocks/shadowsocks-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
[Coverage Status]: https://jenkins.shadowvpn.org/result/shadowsocks
[Coverage]: https://jenkins.shadowvpn.org/job/Shadowsocks/ws/PYENV/py34/label/linux/htmlcov/index.html
[Android]: https://github.com/shadowsocksr/shadowsocksr-android
[Build Status]: https://travis-ci.org/shadowsocksr/shadowsocksr.svg?branch=manyuser
[Debian sid]: https://packages.debian.org/unstable/python/shadowsocks
[iOS]: https://github.com/shadowsocks/shadowsocks-iOS/wiki/Help
[Issue Tracker]: https://github.com/shadowsocks/shadowsocks/issues?state=open
[Install Server on Windows]: https://github.com/shadowsocks/shadowsocks/wiki/Install-Shadowsocks-Server-on-Windows
[Mailing list]: https://groups.google.com/group/shadowsocks
[Issue Tracker]: https://github.com/shadowsocksr/shadowsocksr/issues?state=open
[OpenWRT]: https://github.com/shadowsocks/openwrt-shadowsocks
[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
[Travis CI]: https://travis-ci.org/shadowsocks/shadowsocks
[Troubleshooting]: https://github.com/shadowsocks/shadowsocks/wiki/Troubleshooting
[Wiki]: https://github.com/shadowsocks/shadowsocks/wiki
[Windows]: https://github.com/shadowsocks/shadowsocks-csharp
[macOS]: https://github.com/shadowsocksr/ShadowsocksX-NG
[Travis CI]: https://travis-ci.org/shadowsocksr/shadowsocksr
[Windows]: https://github.com/shadowsocksr/shadowsocksr-csharp
[Wiki]: https://github.com/breakwa11/shadowsocks-rss/wiki
15 changes: 15 additions & 0 deletions apiconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Config
API_INTERFACE = 'sspanelv2' #mudbjson, sspanelv2, sspanelv3, sspanelv3ssr, glzjinmod, legendsockssr, muapiv2(not support)
UPDATE_TIME = 60
SERVER_PUB_ADDR = '127.0.0.1' # mujson_mgr need this to generate ssr link

#mudb
MUDB_FILE = 'mudb.json'

# Mysql
MYSQL_CONFIG = 'usermysql.json'

# API
MUAPI_CONFIG = 'usermuapi.json'


99 changes: 99 additions & 0 deletions asyncmgr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import time
import os
import socket
import struct
import re
import logging
from shadowsocks import common
from shadowsocks import lru_cache
from shadowsocks import eventloop
import server_pool
import Config

class ServerMgr(object):

def __init__(self):
self._loop = None
self._request_id = 1
self._hosts = {}
self._hostname_status = {}
self._hostname_to_cb = {}
self._cb_to_hostname = {}
self._last_time = time.time()
self._sock = None
self._servers = None

def add_to_loop(self, loop):
if self._loop:
raise Exception('already add to loop')
self._loop = loop
# TODO when dns server is IPv6
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
self._sock.bind((Config.MANAGE_BIND_IP, Config.MANAGE_PORT))
self._sock.setblocking(False)
loop.add(self._sock, eventloop.POLL_IN, self)

def _handle_data(self, sock):
data, addr = sock.recvfrom(128)
#manage pwd:port:passwd:action
args = data.split(':')
if len(args) < 4:
return
if args[0] == Config.MANAGE_PASS:
if args[3] == '0':
server_pool.ServerPool.get_instance().cb_del_server(args[1])
elif args[3] == '1':
server_pool.ServerPool.get_instance().new_server(args[1], args[2])

def handle_event(self, sock, fd, event):
if sock != self._sock:
return
if event & eventloop.POLL_ERR:
logging.error('mgr socket err')
self._loop.remove(self._sock)
self._sock.close()
# TODO when dns server is IPv6
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
self._sock.setblocking(False)
self._loop.add(self._sock, eventloop.POLL_IN, self)
else:
self._handle_data(sock)

def close(self):
if self._sock:
if self._loop:
self._loop.remove(self._sock)
self._sock.close()
self._sock = None


def test():
pass

if __name__ == '__main__':
test()
Loading