Commit Graph

782 Commits

Author SHA1 Message Date
a0aa9173a8 Fix for Python3 map changed behavior
In Python3, map returns an iterator instead of list in Python2,
which cause map "lazier" than before, wrap with list() force it running.
2015-02-01 02:37:30 +08:00
79b9b53dbe Never process empty string and prevent infinite loop
If user provide an empty string as network range, inet_pton will
treate it as an IPv6 unspecified address, it seems a bug but I
can't confirm. Then empty string will be converted to 0, 0 & 1
always be zero, so it caused dead loop.
2015-02-01 01:57:17 +08:00
070108f78b Disable forbidden ip feature for local shadowsocks
Since forbidden ip is server-side only, disable it for local-side.
This commit also supress warning about IPv6 loopback because I can
confirm ::1/128 is the only loopback address, not like IPv4.
2015-02-01 01:34:23 +08:00
b11d848986 Fix for Python3 lambda behavior change
In Python3, lambda no longer support use tuple as syntax.
So, ugly changes is inevitable.
2015-02-01 01:34:18 +08:00
aa28796524 Make common fit PEP8 2015-02-01 01:34:13 +08:00
8af359ae05 Use IPNetwork supporting forbidden ip feature in config utils
This commit also make "forbidden_ip" field available in config file.
If no forbidden ip specified in command line and config file,
default to "127.0.0.0/8,::1".
2015-01-31 22:56:23 +08:00
100ebcf064 Add IPNetwork class to support CIDR calculation
Usage:
Use IPNetwork(str|list<str>) to create an IPNetwork object.
Use operator 'in' to determine whether the specified
IP address is in the IP network or not, like:
>>> '192.168.1.1' in IPNetwork('192.168.1.0/24')
True

Both IPv4 and IPv6 address are supported.
Note: When using string to initialize the IPNetwork,
a comma seperated IP network list should be provided.

Currently, IPNetwork just support standard CIDR like:
x.x.x.x/y eg. 192.168.1.0/24
::x/y     eg. ::1/10
If pure IP address was provided,
it will be treated as implicit IP network,
like 192.168.0.0 will be treated as 192.168.0.0/16
and  192.168.1.1 will be treated as 192.168.1.1/32
This implicit translate may cause some unexpected behavior,
like user provide 192.168.2.0 and expect it will be treated as
192.168.2.0/24 but actually it will be translated to
192.168.2.0/23 because there are 9 continuous 0 from right.
In order to avoid confusion, a warning message
will be displayed when pure IP address was provided.

Other variants of CIDR are not supported yet.
2015-01-31 22:56:16 +08:00
8783e0e9ae Move is_ip from asyncdns to common
Since implement CIDR forbidden need this function,
move it to common file seems to be a better choice.
2015-01-31 22:56:09 +08:00
ada97ab6d9 improve comments 2015-01-31 02:58:40 +08:00
5316b3bf11 update .gitignore 2015-01-28 17:17:05 +08:00
4a2d98b280 update coverage url 2015-01-24 14:43:11 +08:00
51f47ccb91 update coverage url 2015-01-24 14:28:39 +08:00
70ebd2ef28 bump 2015-01-23 17:35:32 +08:00
1f8819f790 fix #270 2015-01-23 17:33:48 +08:00
0e6a4cd8ff output python version in unit tests 2015-01-23 14:06:01 +08:00
f4052fbc84 fix MANIFEST.in 2015-01-21 14:32:55 +08:00
5e5d25efd9 Update CONTRIBUTING.md 2015-01-19 16:20:08 +08:00
2e9ce11ea1 bump 2015-01-18 18:32:04 +08:00
6efb3d00e4 fix #264 2015-01-16 18:52:40 +08:00
13413267dc Update README.md 2015-01-16 17:06:48 +08:00
bd22e3ef75 try every dll that matches by name in PATH 2015-01-16 16:50:18 +08:00
5179e018e2 bump 2015-01-14 13:12:12 +08:00
af6c6f3f23 also search lib* for library names 2015-01-14 12:59:43 +08:00
5c05a74727 fix a potential name conflict 2015-01-13 00:42:27 +08:00
53a7e4d0e4 remove print 2015-01-12 23:21:16 +08:00
5e476843ec fix python3 2015-01-12 23:19:24 +08:00
32a6b8fd7a update CHANGES 2015-01-12 23:13:29 +08:00
9fe2f4ef16 bump 2015-01-12 23:11:23 +08:00
f7316c0047 change logging level for UDP warning 2015-01-12 23:08:27 +08:00
cc36de5a2f fix pep8 2015-01-12 23:05:19 +08:00
4312eb9e58 add forbidden support for UDP and add tests 2015-01-12 23:02:59 +08:00
eb94bd1cc3 support forbidden iplist 2015-01-12 22:30:03 +08:00
f29bfb0cc7 remove salsa20-ctr test 2015-01-12 14:15:41 +08:00
80b8bd7014 remove M2Crypto completely 2015-01-12 14:11:33 +08:00
a4b0ea5b8f fix find_library 2015-01-12 14:08:21 +08:00
e582b2b929 rename ctypes_* and remove salsa20-ctr 2015-01-12 14:05:20 +08:00
3d03dbf716 extract find_library 2015-01-12 14:00:35 +08:00
1becc9362d Merge pull request #257 from fa08c/master
Searching libcrypto.so in more locations
2015-01-12 13:07:00 +08:00
ebfd1486d8 Removing the overhead of creating a new list per event 2015-01-12 10:32:03 +08:00
6eadfca78e Removing trailing whites 2015-01-11 15:19:31 +08:00
3294a92a61 Search libcrypto.so in more locations
Some linux distro may store .so in some alternative locations. Now we
try harder to find them.
2015-01-10 22:26:20 +08:00
2711002142 Merge remote-tracking branch 'upstream/master' 2015-01-10 21:27:41 +08:00
18da3554ff Minor fix: never use except: unless you reraise 2015-01-08 08:27:28 -06:00
a5fc1c7e5f Merge pull request #248 from peterfyj/master
Set default method as bytes.
2015-01-08 14:22:26 +08:00
8b2deb01d8 Set default method as bytes.
Default method as string may cause false error report.
2015-01-08 11:22:34 +08:00
176e97bb45 Fixing some minor issues 2015-01-08 11:03:12 +08:00
b6efc0efd9 Update README.md 2015-01-08 04:18:38 +08:00
4598e09b78 now works on OpenWRT 2015-01-07 00:25:28 +08:00
363965c364 Update CONTRIBUTING.md 2015-01-06 20:13:45 +08:00
a90c354f42 update README 2015-01-06 19:41:20 +08:00