MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _initialize_proxy_settings

Function _initialize_proxy_settings

api_utils/app.py:79–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77
78
79def _initialize_proxy_settings():
80 stream_port_env = get_environment_variable("STREAM_PORT")
81 if stream_port_env == "0":
82 proxy_server_url = get_environment_variable(
83 "HTTPS_PROXY"
84 ) or get_environment_variable("HTTP_PROXY")
85 else:
86 proxy_server_url = f"http://127.0.0.1:{stream_port_env or 3120}/"
87
88 if proxy_server_url:
89 state.PLAYWRIGHT_PROXY_SETTINGS = {"server": proxy_server_url}
90 if NO_PROXY_ENV:
91 state.PLAYWRIGHT_PROXY_SETTINGS["bypass"] = NO_PROXY_ENV.replace(",", ";")
92 state.logger.info(
93 f"Playwright proxy settings configured: {state.PLAYWRIGHT_PROXY_SETTINGS}"
94 )
95 else:
96 state.logger.info("No proxy configured for Playwright.")
97
98
99async def _start_stream_proxy():

Calls 2

get_environment_variableFunction · 0.90
infoMethod · 0.80