mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-14 23:33:28 +00:00
SOCKS5H support for httpclient (#25070)
- Added support for SOCKS5h (h for proxy-side DNS resolving) to
httpclient
- Deprecated `auth` arguments for `newProxy` constructors, for auth to
be embedded in the url.
Unfortunately `http://example.com` is not currently reachable from
github CI, so the tests fail there for a few days already, I'm not sure
what can be done here.
(cherry picked from commit 161b321796)
This commit is contained in:
@@ -107,6 +107,13 @@ proc asyncTest() {.async.} =
|
||||
# client = newAsyncHttpClient(proxy = newProxy("http://51.254.106.76:80/"))
|
||||
# var resp = await client.request("https://github.com")
|
||||
# echo resp
|
||||
#
|
||||
# SOCKS5H proxy test
|
||||
# when manualTests:
|
||||
# block:
|
||||
# client = newAsyncHttpClient(proxy = newProxy("socks5h://user:blabla@127.0.0.1:9050"))
|
||||
# var resp = await client.request("https://api.my-ip.io/v2/ip.txt")
|
||||
# echo await resp.body
|
||||
|
||||
proc syncTest() =
|
||||
var client = newHttpClient()
|
||||
|
||||
Reference in New Issue
Block a user