mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-08-21 16:51:45 +00:00
Implement server side ACL & an example script
This commit is contained in:
7030
docs/acl/chnroutes.acl
Normal file
7030
docs/acl/chnroutes.acl
Normal file
File diff suppressed because it is too large
Load Diff
20
docs/acl/chnroutes.py
Normal file
20
docs/acl/chnroutes.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import urllib.request
|
||||
from itertools import chain
|
||||
from datetime import date
|
||||
|
||||
data_ipv4 = urllib.request.urlopen(
|
||||
'https://www.ipdeny.com/ipblocks/data/aggregated/cn-aggregated.zone')
|
||||
data_ipv6 = urllib.request.urlopen(
|
||||
'https://www.ipdeny.com/ipv6/ipaddresses/aggregated/cn-aggregated.zone')
|
||||
|
||||
data = chain(data_ipv4, data_ipv6)
|
||||
|
||||
with open('chnroutes.acl', 'w') as out:
|
||||
out.write('# chnroutes\n# Generated on %s\n\n' %
|
||||
date.today().strftime("%B %d, %Y"))
|
||||
for l in data:
|
||||
ls = str(l, 'UTF8').strip()
|
||||
if ls:
|
||||
out.write('direct cidr %s\n' % ls)
|
Reference in New Issue
Block a user