Skip to content

How to dynamically update the proxy address of an object after it is created, and whether there is a similar method in HTTPX like using "session.proxies.update"? #2617

@RavenCri

Description

@RavenCri

Please tell me how to do it. Thank you very much. I need the help of the community.

import requests
session = requests.Session()
proxies = {
    "http": "http://old-proxy-ip:port",
    "https": "http://old-proxy-ip:port",
}
session.proxies.update(proxies)
new_proxies = {
    "http": "http://new-proxy-ip:port",
    "https": "http://new-proxy-ip:port",
}
session.proxies.update(new_proxies)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions