psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.19k stars 9.33k forks source link

QUIC over Socks5/UDP capable proxy is not working. #6783

Closed ezbik closed 3 months ago

ezbik commented 3 months ago

QUIC over Socks5/UDP capable proxy is not working.

Expected Result

QUIC/HTTP3 worked over Socks5+UDP.

Actual Result

<Response HTTP/2 [200]>
SOCKSHTTPSConnectionPool(host='bbc.com', port=443): Read timed out. (read timeout=2)

Reproduction Steps


import niquests

PX='socks5h://127.0.0.1:1212'

proxies = { 'http': PX, 'https': PX, }
session = niquests.Session()
session.proxies.update(proxies)

timeout=2

Q_SITE='https://bbc.com'  
for i in [1,2]:
    try:
        r = session.get(Q_SITE , timeout=timeout)
        print(r)
    except Exception as e:
        print(e)

System Information

$ python -m requests.help

{
  "charset_normalizer": {
    "version": "3.3.2"
  },
  "http1": {
    "h11": "0.14.0"
  },
  "http2": {
    "jh2": "5.0.3"
  },
  "http3": {
    "enabled": true,
    "qh3": "1.0.8"
  },
  "idna": {
    "version": "3.7"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.10.6"
  },
  "niquests": {
    "version": "3.7.2"
  },
  "ocsp": {
    "enabled": true
  },
  "platform": {
    "release": "5.15.0-56-generic",
    "system": "Linux"
  },
  "system_ssl": {
    "version": "30000020"
  },
  "urllib3.future": {
    "cohabitation_version": null,
    "version": "2.8.904"
  },
  "wassima": {
    "certifi_fallback": false,
    "enabled": true,
    "version": "1.1.1"
  }
}
nateprewitt commented 3 months ago

Hi @ezbik, Requests notes it only supports http/1.1 throughout our documentation.

Any issues with other libraries trying to add QUIC or h2 support on top of Requests will need to be triaged there. We do not support this functionality.

ezbik commented 3 months ago

@nateprewitt then the documentation (proxies section) should be updated to prevent the users even trying to use http2 or http3 through the proxies..

nateprewitt commented 3 months ago

Can you point to what in our documentation suggested we'd be able to support new protocols specifically over SOCKS that we don't support otherwise?