diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/http.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http.lua b/src/http.lua index bda0744..e93003d 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -219,9 +219,11 @@ local function adjustproxy(reqt) | |||
| 219 | local proxy = reqt.proxy or _M.PROXY | 219 | local proxy = reqt.proxy or _M.PROXY |
| 220 | if proxy then | 220 | if proxy then |
| 221 | proxy = url.parse(proxy) | 221 | proxy = url.parse(proxy) |
| 222 | return proxy.host, proxy.port or 3128 | 222 | proxy.port = proxy.port or 3128 |
| 223 | proxy.create = SCHEMES[proxy.scheme].create(reqt) | ||
| 224 | return proxy.host, proxy.port, proxy.create | ||
| 223 | else | 225 | else |
| 224 | return reqt.host, reqt.port | 226 | return reqt.host, reqt.port, reqt.create |
| 225 | end | 227 | end |
| 226 | end | 228 | end |
| 227 | 229 | ||
| @@ -291,7 +293,10 @@ local function adjustrequest(reqt) | |||
| 291 | end | 293 | end |
| 292 | 294 | ||
| 293 | -- ajust host and port if there is a proxy | 295 | -- ajust host and port if there is a proxy |
| 294 | nreqt.host, nreqt.port = adjustproxy(nreqt) | 296 | local proxy_create |
| 297 | nreqt.host, nreqt.port, proxy_create = adjustproxy(nreqt) | ||
| 298 | if not reqt.create then nreqt.create = proxy_create end | ||
| 299 | |||
| 295 | return nreqt | 300 | return nreqt |
| 296 | end | 301 | end |
| 297 | 302 | ||
