mirror of https://github.com/dnomd343/ProxyC
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
636 B
30 lines
636 B
#!/usr/bin/python
|
|
# -*- coding:utf-8 -*-
|
|
|
|
from ProxyFilter import Shadowsocks
|
|
|
|
def filter(raw):
|
|
'''
|
|
代理信息过滤并格式化
|
|
|
|
参数无效:
|
|
return False, {reason}
|
|
|
|
参数有效:
|
|
return True, {
|
|
'...': '...',
|
|
'...': '...',
|
|
...
|
|
}
|
|
|
|
'''
|
|
try:
|
|
if not 'type' in raw:
|
|
return False, 'Missing `type` option'
|
|
if raw['type'] == 'ss':
|
|
return Shadowsocks.ssFilter(raw)
|
|
else:
|
|
return False, 'Unknown proxy type'
|
|
except:
|
|
pass
|
|
return False, 'Unknown error'
|
|
|