diff --git a/src/http.lua b/src/http.lua index 1330355f..e2787d9b 100644 --- a/src/http.lua +++ b/src/http.lua @@ -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 + 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