use configuration names without spaces
This commit is contained in:
parent
984eac6129
commit
c61ebf63a1
32
main.py
32
main.py
@ -33,17 +33,17 @@ class LoadConfig:
|
|||||||
allow_no_value=True, delimiters=('=',),
|
allow_no_value=True, delimiters=('=',),
|
||||||
inline_comment_prefixes=('#',))
|
inline_comment_prefixes=('#',))
|
||||||
self.config.read(configfile)
|
self.config.read(configfile)
|
||||||
self.proxy_name = self.config['General'].get('ProxAddr')
|
self.proxy_name = self.config['general'].get('proxAddr')
|
||||||
self.front_name = self.config['General'].get('FrontAddr', 'localhost')
|
self.front_name = self.config['general'].get('frontAddr', 'localhost')
|
||||||
self.rear_name = self.config['General'].get('RearAddr', 'localhost')
|
self.rear_name = self.config['general'].get('rearAddr', 'localhost')
|
||||||
self.front_port = int(self.config['General'].get('FrontPort'))
|
self.front_port = int(self.config['general'].get('frontPort'))
|
||||||
self.rear_port = int(self.config['General'].get('RearPort'))
|
self.rear_port = int(self.config['general'].get('rearPort'))
|
||||||
self.proxy = self.config['General'].get('DefaultProxy')
|
self.proxy = self.config['general'].get('defaultProxy')
|
||||||
self.loglevel = self.config['General'].get('LogLevel')
|
self.loglevel = self.config['general'].get('logLevel')
|
||||||
self.ca = self.config['General'].get('CACert')
|
self.ca = self.config['general'].get('caCert')
|
||||||
self.certdir = self.config['General'].get('CertDir')
|
self.certdir = self.config['general'].get('certDir')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ConnectionPools:
|
class ConnectionPools:
|
||||||
"""
|
"""
|
||||||
self.pools is a list of {'proxy': 'http://127.0.0.1:8080',
|
self.pools is a list of {'proxy': 'http://127.0.0.1:8080',
|
||||||
@ -69,13 +69,13 @@ class ConnectionPools:
|
|||||||
self.conf.read(self.file)
|
self.conf.read(self.file)
|
||||||
self.pools = []
|
self.pools = []
|
||||||
proxy_sections = [section for section in self.conf.sections()
|
proxy_sections = [section for section in self.conf.sections()
|
||||||
if section.startswith('Proxy')]
|
if section.startswith('proxy')]
|
||||||
for section in proxy_sections:
|
for section in proxy_sections:
|
||||||
proxy = section.split()[1]
|
proxy = section.split()[1]
|
||||||
self.pools.append(dict(proxy=proxy,
|
self.pools.append(dict(proxy=proxy,
|
||||||
pool=self.setProxyPool(proxy),
|
pool=self.setProxyPool(proxy),
|
||||||
patterns=list(self.conf[section].keys())))
|
patterns=list(self.conf[section].keys())))
|
||||||
default_proxy = self.conf['General'].get('DefaultProxy')
|
default_proxy = self.conf['general'].get('defaultProxy')
|
||||||
|
|
||||||
if default_proxy:
|
if default_proxy:
|
||||||
default_pool = self.setProxyPool(default_proxy)
|
default_pool = self.setProxyPool(default_proxy)
|
||||||
@ -93,10 +93,10 @@ class ConnectionPools:
|
|||||||
sections = collections.defaultdict(dict)
|
sections = collections.defaultdict(dict)
|
||||||
for name in self.conf.sections():
|
for name in self.conf.sections():
|
||||||
sections[name] = self.conf[name]
|
sections[name] = self.conf[name]
|
||||||
self.noverifylist = list(sections['TLS NoVerify'].keys())
|
self.noverifylist = list(sections['noVerify'].keys())
|
||||||
self.sslpasslist = list(sections['TLS Passthru'].keys())
|
self.sslpasslist = list(sections['passthru'].keys())
|
||||||
self.blacklist = list(sections['Blacklist'].keys())
|
self.blacklist = list(sections['blacklist'].keys())
|
||||||
self.bypasslist = list(sections['Bypass URL'].keys())
|
self.bypasslist = list(sections['bypassURL'].keys())
|
||||||
|
|
||||||
def reloadConfig(self):
|
def reloadConfig(self):
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
Reference in New Issue
Block a user