📜  python 请求强制 ipv4 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:57.498000             🧑  作者: Mango

代码示例1
import socket
import requests.packages.urllib3.util.connection as urllib3_cn
 
def allowed_gai_family():
    family = socket.AF_INET    # force IPv4
    return family
 
urllib3_cn.allowed_gai_family = allowed_gai_family