python / python/cpython

CIDR support for proxy bypass list

Offen
#149,746 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

stdlib triaged type-feature
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Feature or enhancement

Proposal:

I propose adding universal support for CIDR-notation IP addresses when reading NO_PROXY / the OS-specific equivalents.

Currently, support for NO_PROXY is a bit inconsistent, both across the ecosystem and within Python. On MacOS using SystemConfiguration, CIDR is supported out of the box, as is the short notation 10.0. The default implementation and the windows nt ProxyOverride registry key do not. Go and curl and wget all support CIDR notation, so despite not being standardized, there is precedent towards this.

In some environments, all outbound traffic is required to go through a proxy. However, traffic to internal services is allowed to be direct (for performance, or inherent trust, or any other reason). An example NO_PROXY may look like NO_PROXY=localhost,.localhost,127.0.0.1,127.0.0.2,0.0.0.0,169.254.169.254,10.0.0.0/8,.internal.,.internal,.local.,.local.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/support-cidr-notation-in-no-proxy/66292 - discussion was tepid but leant towards yes if a good PR was proposed. I'm working on that in tandem with this gh ticket.

Windows specifically: https://github.com/python/cpython/issues/149136

More generally: https://about.gitlab.com/blog/we-need-to-talk-no-proxy/

Linked PRs
  • gh-149744
  • gh-156336

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Durchsicht der verknüpften Arbeiten in gh-149744 und gh-156336, lies anschließend die zugehörige Discourse-Diskussion und das Windows-Issue gh-149136. Das gewünschte Ergebnis ist eine konsistente Handhabung der CIDR-Notation für NO_PROXY und die betriebssystemspezifischen Entsprechungen, einschließlich der aufgeführten Beispiele für interne Netzwerke.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
networking
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.