Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python requests force ipv4

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
Source by pythonadventures.wordpress.com #
 
PREVIOUS NEXT
Tagged: #python #requests #force
ADD COMMENT
Topic
Name
9+2 =