add ability for 3 different proxies
This commit is contained in:
parent
dd45e351c3
commit
949f9b4404
@ -2992,18 +2992,22 @@ if __name__ == '__main__':
|
|||||||
aprs_thread.start()
|
aprs_thread.start()
|
||||||
# Create file for static positions - by IU7IGU
|
# Create file for static positions - by IU7IGU
|
||||||
## open("nom_aprs","w").close
|
## open("nom_aprs","w").close
|
||||||
|
|
||||||
if CONFIG['PROXY_A']['ENABLED']:
|
if CONFIG['PROXY_A']['ENABLED']:
|
||||||
proxy_thread = threading.Thread(target=hotspot_proxy, args=(CONFIG['PROXY_A']['EXTERNAL_PORT'],CONFIG['PROXY_A']['INTERNAL_PORT_START'],CONFIG['PROXY_A']['INTERNAL_PORT_STOP'],))
|
if not CONFIG['PROXY_A']['USE_EXTERNAL_PROXY']:
|
||||||
proxy_thread.daemon = True
|
proxy_thread = threading.Thread(target=hotspot_proxy, args=(CONFIG['PROXY_A']['EXTERNAL_PORT'],CONFIG['PROXY_A']['INTERNAL_PORT_START'],CONFIG['PROXY_A']['INTERNAL_PORT_STOP'],))
|
||||||
proxy_thread.start()
|
proxy_thread.daemon = True
|
||||||
|
proxy_thread.start()
|
||||||
if CONFIG['PROXY_B']['ENABLED']:
|
if CONFIG['PROXY_B']['ENABLED']:
|
||||||
proxy_thread = threading.Thread(target=hotspot_proxy, args=(CONFIG['PROXY_B']['EXTERNAL_PORT'],CONFIG['PROXY_B']['INTERNAL_PORT_START'],CONFIG['PROXY_B']['INTERNAL_PORT_STOP'],))
|
if not CONFIG['PROXY_B']['USE_EXTERNAL_PROXY']:
|
||||||
proxy_thread.daemon = True
|
proxy_thread = threading.Thread(target=hotspot_proxy, args=(CONFIG['PROXY_B']['EXTERNAL_PORT'],CONFIG['PROXY_B']['INTERNAL_PORT_START'],CONFIG['PROXY_B']['INTERNAL_PORT_STOP'],))
|
||||||
proxy_thread.start()
|
proxy_thread.daemon = True
|
||||||
|
proxy_thread.start()
|
||||||
if CONFIG['PROXY_C']['ENABLED']:
|
if CONFIG['PROXY_C']['ENABLED']:
|
||||||
proxy_thread = threading.Thread(target=hotspot_proxy, args=(CONFIG['PROXY_C']['EXTERNAL_PORT'],CONFIG['PROXY_C']['INTERNAL_PORT_START'],CONFIG['PROXY_C']['INTERNAL_PORT_STOP'],))
|
if not CONFIG['PROXY_C']['USE_EXTERNAL_PROXY']:
|
||||||
proxy_thread.daemon = True
|
proxy_thread = threading.Thread(target=hotspot_proxy, args=(CONFIG['PROXY_C']['EXTERNAL_PORT'],CONFIG['PROXY_C']['INTERNAL_PORT_START'],CONFIG['PROXY_C']['INTERNAL_PORT_STOP'],))
|
||||||
proxy_thread.start()
|
proxy_thread.daemon = True
|
||||||
|
proxy_thread.start()
|
||||||
|
|
||||||
logger.info('Unit calls will be bridged to: ' + str(UNIT))
|
logger.info('Unit calls will be bridged to: ' + str(UNIT))
|
||||||
reactor.run()
|
reactor.run()
|
||||||
|
@ -204,6 +204,7 @@ def build_config(_config_file):
|
|||||||
elif section == 'PROXY_A':
|
elif section == 'PROXY_A':
|
||||||
CONFIG['PROXY_A'].update({
|
CONFIG['PROXY_A'].update({
|
||||||
'ENABLED': config.getboolean(section, 'ENABLED'),
|
'ENABLED': config.getboolean(section, 'ENABLED'),
|
||||||
|
'USE_EXTERNAL_PROXY': config.getboolean(section, 'USE_EXTERNAL_PROXY'),
|
||||||
'NAME': config.get(section, 'NAME'),
|
'NAME': config.get(section, 'NAME'),
|
||||||
'REPEAT': config.getboolean(section, 'REPEAT'),
|
'REPEAT': config.getboolean(section, 'REPEAT'),
|
||||||
'EXTERNAL_PORT': config.getint(section, 'EXTERNAL_PORT'),
|
'EXTERNAL_PORT': config.getint(section, 'EXTERNAL_PORT'),
|
||||||
@ -221,6 +222,7 @@ def build_config(_config_file):
|
|||||||
elif section == 'PROXY_B':
|
elif section == 'PROXY_B':
|
||||||
CONFIG['PROXY_B'].update({
|
CONFIG['PROXY_B'].update({
|
||||||
'ENABLED': config.getboolean(section, 'ENABLED'),
|
'ENABLED': config.getboolean(section, 'ENABLED'),
|
||||||
|
'USE_EXTERNAL_PROXY': config.getboolean(section, 'USE_EXTERNAL_PROXY'),
|
||||||
'NAME': config.get(section, 'NAME'),
|
'NAME': config.get(section, 'NAME'),
|
||||||
'REPEAT': config.getboolean(section, 'REPEAT'),
|
'REPEAT': config.getboolean(section, 'REPEAT'),
|
||||||
'EXTERNAL_PORT': config.getint(section, 'EXTERNAL_PORT'),
|
'EXTERNAL_PORT': config.getint(section, 'EXTERNAL_PORT'),
|
||||||
@ -238,6 +240,7 @@ def build_config(_config_file):
|
|||||||
elif section == 'PROXY_C':
|
elif section == 'PROXY_C':
|
||||||
CONFIG['PROXY_C'].update({
|
CONFIG['PROXY_C'].update({
|
||||||
'ENABLED': config.getboolean(section, 'ENABLED'),
|
'ENABLED': config.getboolean(section, 'ENABLED'),
|
||||||
|
'USE_EXTERNAL_PROXY': config.getboolean(section, 'USE_EXTERNAL_PROXY'),
|
||||||
'NAME': config.get(section, 'NAME'),
|
'NAME': config.get(section, 'NAME'),
|
||||||
'REPEAT': config.getboolean(section, 'REPEAT'),
|
'REPEAT': config.getboolean(section, 'REPEAT'),
|
||||||
'EXTERNAL_PORT': config.getint(section, 'EXTERNAL_PORT'),
|
'EXTERNAL_PORT': config.getint(section, 'EXTERNAL_PORT'),
|
||||||
|
Loading…
Reference in New Issue
Block a user