mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-05-01 04:36:45 +02:00
fix(http): use the right protocol for proxies
This commit is contained in:
parent
95b7efa9da
commit
bd0f2ea49a
@ -219,7 +219,8 @@ local function adjustproxy(reqt)
|
||||
local proxy = reqt.proxy or _M.PROXY
|
||||
if proxy then
|
||||
proxy = url.parse(proxy)
|
||||
return proxy.host, proxy.port or 3128
|
||||
local proxy_create = SCHEMES[proxy.scheme].create(reqt)
|
||||
return proxy.host, proxy.port or 3128, proxy_create
|
||||
else
|
||||
return reqt.host, reqt.port
|
||||
end
|
||||
@ -291,7 +292,7 @@ local function adjustrequest(reqt)
|
||||
end
|
||||
|
||||
-- ajust host and port if there is a proxy
|
||||
nreqt.host, nreqt.port = adjustproxy(nreqt)
|
||||
nreqt.host, nreqt.port, nreqt.create = adjustproxy(nreqt)
|
||||
return nreqt
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user