WARP-Clash-API/utils/proxy.py
vvbbnn00 1e6349a545 Uniform Code Formatting
Unify variables and constants to use the snake_case naming convention, and use camelCase for method names.
2024-01-28 23:47:47 +08:00

19 lines
405 B
Python

import requests
from config import PROXY_POOL_URL
def getProxy():
"""
Get proxy from proxy pool
:return: proxy got from proxy pool
"""
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