xvzc / SpoofDPI

A simple and fast anti-censorship tool written in Go
Apache License 2.0
3.72k stars 255 forks source link

Not working with -enable-doh and local dnscrypt since 0.10.7 #237

Open XZVB12 opened 2 months ago

XZVB12 commented 2 months ago

Version

0.10.7 - 0.11.1

Operating System

Arch Linux

How are you running SpoofDPI?

./spoofdpi -dns-addr 127.0.0.4 -enable-doh -port 8087

Description

Hello, thank you for your project. Today I tried to upgrade from 0.10.6 to 0.11.1 and found that I can't longer use the local dnscrypt as a dns source. When i try to go to the site, the browser says that the connection failed. if I specify 1.1.1.1 as the source of a dns such problem is not. Version 0.10.6 is not affected by this and works without problems. Any idea what might be the reason? Thank you. UPD: It looks like the reason is -enable-doh, if you remove it everything works.

Ledorub commented 2 months ago

In v0.10.6 -dns-addr didn't have any effect on DoH. https://github.com/xvzc/SpoofDPI/blob/641ded49d82fcdbea2f5734e78c9e0cc673b0cca/dns/dns.go#L94

Starting from v0.10.7, DoH URL is composed as follows: https://github.com/xvzc/SpoofDPI/blob/bdc1a68691173a20b791f6bca83905cd0004f8c8/dns/doh.go#L45-L47

Where host is a host or an IP you provide as -dns-addr, or 8.8.8.8.

XZVB12 commented 2 months ago

Then it’s clear. dnscrypt implements this on different ports dns 127.0.0.4:53 and DOH 127.0.0.1:3000 Is it possible to implement something similar in this project ? I tried -dns-addr 127.0.0.1 -dns-port 3000 -enable-doh Unfortunately not working

munrocket commented 1 month ago

Can confirm.