chg: [websockets client] bind client ip

This commit is contained in:
Terrtia 2022-05-10 13:24:32 +02:00
parent 1dfa796dca
commit 19969a02b2
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 10 additions and 0 deletions

View file

@ -20,6 +20,14 @@ sys.path.append(os.environ['AIL_BIN'])
# Import Project packages # Import Project packages
################################## ##################################
from core import ail_2_ail from core import ail_2_ail
from lib.ConfigLoader import ConfigLoader
config_loader = ConfigLoader()
local_addr = config_loader.get_config_str('AIL_2_AIL', 'local_addr')
if not local_addr or local_addr == None:
local_addr = None
config_loader = None
#### LOGS #### #### LOGS ####
redis_logger = publisher redis_logger = publisher
@ -112,6 +120,7 @@ async def ail_to_ail_client(ail_uuid, sync_mode, api, ail_key=None, client_id=No
async with websockets.connect( async with websockets.connect(
uri, uri,
ssl=ssl_context, ssl=ssl_context,
local_addr=local_addr,
#open_timeout=10, websockers 10.0 /!\ python>=3.7 #open_timeout=10, websockers 10.0 /!\ python>=3.7
extra_headers={"Authorization": f"{ail_key}"} extra_headers={"Authorization": f"{ail_key}"}
) as websocket: ) as websocket:

View file

@ -60,6 +60,7 @@ DiffMaxLineLength = 10000
[AIL_2_AIL] [AIL_2_AIL]
server_host = 0.0.0.0 server_host = 0.0.0.0
server_port = 4443 server_port = 4443
local_addr =
#### Modules #### #### Modules ####
[BankAccount] [BankAccount]