WARP-Clash-API/utils/proxy.py
vvbbnn00 8f347f2ea8 Add proxy pool URL configuration and update Dockerfile
This update allows the IP proxy pool address to be configured for obtaining WARP+ traffic. This is achieved by adding a PROXY_POOL_URL environment variable. Dockerfile has also been updated to change the Alpine source and add new dependencies. Scripts have been modified to accommodate these changes.
2024-01-11 21:32:02 +08:00

15 lines
316 B
Python

import requests
from config import PROXY_POOL_URL
def getProxy():
ret = requests.get(PROXY_POOL_URL).json()
proxy = {}
if ret.get('proxy'):
if ret['https']:
proxy = {"https": {ret['proxy']}}
else:
proxy = {"http": {ret['proxy']}}
return proxy