about ipv6_first mode
The sni proxy server has an IPv6 address, but can only access googlevideo.com (youtube) via ipv4 address (ipv6 youtube address is blocked). When sniproxy works in ipv4_only mode, YouTube can be accessed via sniproxy server, but in ipv6_first mode, it can't work.
It sounds like you may not have IPv6 connectivity to the site which the hostname resolves to. I would check your IPv6 connectivity and enable debug logging and see if there are any clues there.
It sounds like you may not have IPv6 connectivity to the site which the hostname resolves to. I would check your IPv6 connectivity and enable debug logging and see if there are any clues there.
No. the sni proxy server can access IPv6 address normally such as google.com, facebook.com. the all googlevideo.com ipv6 address are blocked by my ISP. so I access youtube using proxy server( ipv4 address).
Now I have modified the source code and it works fine, but it is just a temporary solution.
/* **** resolv.c ****** */ struct ResolvQuery * resolv_query(const char *hostname, int mode, void (*client_cb)(struct Address *, void *), void (*client_free_cb)(void *), void *client_cb_data) { struct dns_ctx *ctx = (struct dns_ctx *)resolv_io_watcher.data;
/*
* Wrap udns's call back in our own
*/
struct ResolvQuery *cb_data = malloc(sizeof(struct ResolvQuery));
if (cb_data == NULL) {
err("Failed to allocate memory for DNS query callback data.");
return NULL;
}
if( strstr( hostname, "googlevideo.com" ) != NULL ) mode = 1; /* added this line */
....
sniproxy config file, v2019.01.18
user daemon
PID file
pidfile /var/run/sniproxy.pid resolver { # Specify name server nameserver 172.16.16.1 # Specify which type of address to lookup in DNS: mode ipv6_first } ....
@wang20150419 since your comfortable working with the source code. I would suggest adding some more debugging to resolve_server_address() and resolv_cb() to see what data in submitted and returned by the resolver and perhaps initiate_server_connect() to see if there is an issue connecting the address returned by the resolver.