Skip to content

Commit 25cbee5

Browse files
authored
Merge pull request #1937 from BastiJoe/add_proxy_functionality
fix: proxy settings from env vars
2 parents 1297440 + 32c60eb commit 25cbee5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

thingsboard_gateway/tb_utility/tb_utility.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ def get_service_environmental_variables():
395395
'privateKey': environ.get('privateKey'),
396396
'cert': environ.get('cert'),
397397
'clientId': environ.get('clientId'),
398-
'password': environ.get('password')
398+
'password': environ.get('password'),
399+
'proxy_host': environ.get('proxy_host'),
400+
'proxy_port': int(environ.get('proxy_port')) if environ.get('proxy_port') else None
399401
}
400402

401403
if platform_system() != 'Windows':
@@ -406,6 +408,10 @@ def get_service_environmental_variables():
406408
env_variables['host'] = environ.get('TB_GW_HOST')
407409
if environ.get('TB_GW_PORT'):
408410
env_variables['port'] = int(environ.get('TB_GW_PORT'))
411+
if environ.get('TB_GW_PROXY_HOST'):
412+
env_variables['proxy_host'] = environ.get('TB_GW_PROXY_HOST')
413+
if environ.get('TB_GW_PROXY_PORT'):
414+
env_variables['proxy_port'] = int(environ.get('TB_GW_PROXY_PORT'))
409415
if environ.get('TB_GW_SECURITY_TYPE'):
410416
env_variables['type'] = environ.get('TB_GW_SECURITY_TYPE')
411417
if environ.get('TB_GW_ACCESS_TOKEN'):

0 commit comments

Comments
 (0)