add proxy conf

This commit is contained in:
Dmitry Belyaev 2024-02-20 10:58:04 +03:00
parent bbfb4f92af
commit b7097540a2
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -62,8 +62,8 @@ async def output_task(result):
)
async def app(ipv4t, ipv6t):
config = toml.load("settings/config.toml")
async def app(config, ipv4t, ipv6t):
use_plugins(config, ipv4t, ipv6t)
debug = config.get("debug", False)
@ -97,10 +97,13 @@ async def app(ipv4t, ipv6t):
async def main():
config = toml.load("settings/config.toml")
async with httpx.AsyncHTTPTransport(
local_address="0.0.0.0",
) as ipv4t, httpx.AsyncHTTPTransport(local_address="::") as ipv6t:
await app(ipv4t, ipv6t)
local_address="0.0.0.0", proxy=config.get("proxy_v4")
) as ipv4t, httpx.AsyncHTTPTransport(
local_address="::", proxy=config.get("proxy_v6")
) as ipv6t:
await app(config, ipv4t, ipv6t)
if __name__ == "__main__":