Doesn't work with usefixie and quotaguard with `invalidProxyResponse `

Đang mở
#650 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
nodejs, swift
Lĩnh vực
backend, networking

Hướng nghiên cứu

Bắt đầu với HTTPClient.Configuration.Proxy.server và đường dẫn invalidProxyResponse đã được báo cáo, sử dụng bản tái hiện bằng Swift với usefixie.com hoặc quotaguard.com. So sánh hành vi yêu cầu proxy của nó với ví dụ Node.js đang hoạt động; được xem là hoàn tất khi yêu cầu HTTPS thành công thông qua proxy đã xác thực mà không có invalidProxyResponse.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I tried to use it with usefixie.com and quotaguard.com and getting invalidProxyResponse error.

I tried to set breakpoints to debug the issue and see that under the hood these services returns 400 Bad Request

let auth = HTTPClient.Authorization.basic(username: "fixie", password: "___")
let proxyConfig = 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 {
    let res = 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

var http = require('http');

function buildAuthHeader(user, pass) {
    return 'Basic ' + new Buffer(user + ':' + pass).toString('base64');
}

proxy = '___.usefixie.com';
proxy_port = 80;
host = 'ip.quotaguard.com';
url = 'https://ip.quotaguard.com';
user = 'fixie';
pass = '___';

var options = {
    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);
  let chunks = []
    res.on('data', chunk => chunks.push(chunk))
    res.on('end', () => {
      console.log('DONE', Buffer.concat(chunks).toString('utf8'))
    })
}).end();
Ngôn ngữ chính
Swift
Star
1.1k
Fork
159
Merge trung bình
1 giờ 22 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của swift-server/async-http-client

Tất cả issue của swift-server/async-http-client

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.