mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-05-01 20:56:44 +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
|
local proxy = reqt.proxy or _M.PROXY
|
||||||
if proxy then
|
if proxy then
|
||||||
proxy = url.parse(proxy)
|
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
|
else
|
||||||
return reqt.host, reqt.port
|
return reqt.host, reqt.port
|
||||||
end
|
end
|
||||||
@ -291,7 +292,7 @@ local function adjustrequest(reqt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- ajust host and port if there is a proxy
|
-- 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
|
return nreqt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user