- pip3 install asyncio
- pip3 install aiohttp
- pip3 install flask
- python3.7
以轻量级Flask作为服务端,提供接口调用
vim setting.py
pip3 install -r requirements.txt
python3 run.py
import requests
PROXY_POOL_URL = 'http://localhost:5555/random' # 自己服务器网址
def get_proxy():
try:
response = requests.get(PROXY_POOL_URL)
if response.status_code == 200:
return response.text
except ConnectionError:
return None