chobits / ngx_http_proxy_connect_module

A forward proxy module for CONNECT request handling
BSD 2-Clause "Simplified" License
1.84k stars 498 forks source link

proxy_connect_bind ipv6 address #294

Closed Yahook closed 11 months ago

Yahook commented 11 months ago

I'm trying to make a proxy which will use ipv6 address via proxy_connect_bind.

This is an example of code which I use:

server {
    listen 127.0.0.1:3535;    

    # dns resolver used by forward proxying
    resolver 8.8.8.8 ipv6=on;

    # forward proxy for CONNECT requests
    proxy_connect;
    proxy_connect_allow            443 563;
    proxy_connect_connect_timeout  10s;
    proxy_connect_data_timeout     10s;
    proxy_connect_bind IPV6HERE;

    location / {
        proxy_pass http://$host;
        proxy_set_header Host $host;
    }
}

I get an error: 2023/12/12 03:54:18 [crit] 28483#28483: *1 bind(IPV6HERE) failed (97: Address family not supported by protocol) while connecting to upstream, client: 127.0.0.1, ...

I'm not sure if it's a bug or this functionality is missing. Could you please help me? Thanks.