try:
http_client = httpclient.HTTPClient()
response = http_client.fetch(AWS_CHECK_IP, request_timeout=1)
external_ip = response.body.strip()
except (httpclient.HTTPError, RuntimeError) as e:
LOGGER.error(f"Error connecting to {AWS_CHECK_IP}: {e}")
finally:
if http_client is not None:
After Change
if external_ip:
LOGGER.debug(f"proxy.externalIP set to {external_ip}")
else:
print("proxy.externalIP not set, attempting to autodetect IP")
external_ip = get_external_ip()
lan_ip = get_lan_ip()
timeout_secs = config.get_option("proxy.waitForConnectionSecs")