No Server Response when using Proxy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 76
- Avg merge
- 8h 59m
- Merged PRs (30d)
- 24
Description
Originally opened by
@FuckingToasterson 2022-09-05 13:23:01 in encode/httpx
Describe the bug
Earlier, i had a read timeout error when using proxies which i solved by adding timeout=None in the httpx.Client() function.
Now, when choosing http proxies it work fine for some time but it randomly start crashing with a exception: Server closed without sending response
Don't tell me stuff like "that's a duplicate of ..." I've looked on other Answers on Stackoverflow & Github but none of these helped me to solve the issue i am facing.
To Reproduce
Do a http request to discord.com while using proxies:
data1 = {"foo": "bar"}
with httpx.Client(headers=HEADERS, timeout=timeout, proxies=proxyauth if proxytype != "" else None) as client:
resp2 = client.post("https://discord.com/api/v9/users/`@me`", json=data1)
lock.acquire()
if resp2.status_code == 204: pystyle.Write.Print("\t[+] Successfully requested api!\n", pystyle.Colors.green, interval=0)
lock.release()
Expected behavior
In case you use a proxy, it should request the api as usual without the traceback.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Discord request through an HTTP proxy using the shown httpx.Client configuration, recording the Python, httpx, proxy, and traceback details. Trace the request from the Client entry point to the proxy response handling; done means the request completes without the reported server-closed exception under the reproduced conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100