raise-isayan / TunProxy

Android VPN interceptor to send HTTP and HTTPS traffic to a proxy
454 stars 162 forks source link

How to support local DNS #20

Open huangzhouhong opened 1 year ago

huangzhouhong commented 1 year ago

I have started a DNS server on port 5003 locally. However, Builder.addDnsServer doesn't support 127.0.0.1, nor does it support custom ports.

So, I used the following:

String tun_dns = "172.19.0.2";
builder.addDnsServer(tun_dns);
builder.addRoute(tun_dns, 32);

But I'm not sure how to modify udp.c to correctly handle DNS requests.