- Notifications
You must be signed in to change notification settings - Fork136
Open
Description
I tried to use it with usefixie.com and quotaguard.com and gettinginvalidProxyResponse error.
I tried to set breakpoints to debug the issue and see that under the hood these services returns400 Bad Request
letauth=HTTPClient.Authorization.basic(username:"fixie", password:"___")letproxyConfig=HTTPClient.Configuration.Proxy.server(host:"___.usefixie.com", port:80, authorization: auth)app.http.client.configuration.proxy= proxyConfig//app.http.client.configuration.redirectConfiguration = .follow(max: 100, allowCycles: true)do{letres=try app.client.get(URI("https://ip.quotaguard.com/")).wait() app.logger.critical("\(res.body?.string)")}catch{ app.logger.critical("Error:\(error)") // getting HTTPClientError.invalidProxyResponse here}
at the same time with nodejs everything works fine
varhttp=require('http');functionbuildAuthHeader(user,pass){return'Basic '+newBuffer(user+':'+pass).toString('base64');}proxy='___.usefixie.com';proxy_port=80;host='ip.quotaguard.com';url='https://ip.quotaguard.com';user='fixie';pass='___';varoptions={port:proxy_port,host:proxy,path:url,headers:{Host:host,'Proxy-Authorization':buildAuthHeader(user,pass),}};http.get(options,function(res){console.log("StatusCode: "+res.statusCode+" Message: "+res.statusMessage);letchunks=[]res.on('data',chunk=>chunks.push(chunk))res.on('end',()=>{console.log('DONE',Buffer.concat(chunks).toString('utf8'))})}).end();
Metadata
Metadata
Assignees
Labels
No labels