diff --git a/make-releases.sh b/make-releases.sh index cb71abd..d94b8d8 100644 --- a/make-releases.sh +++ b/make-releases.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="v0.10.2" +VERSION="v0.10.3" for osarch in 'darwin/amd64' 'linux/amd64' 'linux/arm' 'linux/arm64' 'linux/mips' 'linux/mipsle'; do GOOS=${osarch%/*} GOARCH=${osarch#*/} go build -ldflags="-w -s -X main.VERSION=${VERSION}" github.com/xvzc/SpoofDPI/cmd/spoof-dpi && diff --git a/proxy/io.go b/proxy/io.go index 3f691a1..a8a1fff 100644 --- a/proxy/io.go +++ b/proxy/io.go @@ -57,9 +57,11 @@ func Serve(from *net.TCPConn, to *net.TCPConn, proto string, fd string, td strin proto += " " for { - from.SetReadDeadline( - time.Now().Add(time.Millisecond * time.Duration(timeout)), - ) + if timeout > 0 { + from.SetReadDeadline( + time.Now().Add(time.Millisecond * time.Duration(timeout)), + ) + } buf, err := ReadBytes(from) if err != nil { diff --git a/proxy/proxy.go b/proxy/proxy.go index 3aad1cf..3cdf451 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -42,7 +42,9 @@ func (pxy *Proxy) Start() { os.Exit(1) } - log.Println(fmt.Sprintf("[PROXY] Connection timeout is set to %dms", pxy.timeout)) + if pxy.timeout > 0 { + log.Println(fmt.Sprintf("[PROXY] Connection timeout is set to %dms", pxy.timeout)) + } log.Println("[PROXY] Created a listener on port", pxy.port) diff --git a/readme.md b/readme.md index 3792c5f..0c501ab 100644 --- a/readme.md +++ b/readme.md @@ -68,7 +68,7 @@ Usage: spoof-dpi [options...] -port int port (default 8080) -timeout int - timeout in milliseconds (default 2000) + timeout in milliseconds. no timeout when not given -url value Bypass DPI only on this url, can be passed multiple times -v print spoof-dpi's version. this may contain some other relevant information @@ -77,7 +77,6 @@ Usage: spoof-dpi [options...] try lower values if the default value doesn't bypass the DPI; set to 0 to use old (pre v0.10.0) client hello splitting method: fragmentation for the first data packet and the rest (default 50) - ``` > If you are using any vpn extensions such as Hotspot Shield in Chrome browser, go to Settings > Extensions, and disable them. diff --git a/readme_ko.md b/readme_ko.md index d3810b8..ca81433 100644 --- a/readme_ko.md +++ b/readme_ko.md @@ -68,7 +68,7 @@ Usage: spoof-dpi [options...] -port int port (default 8080) -timeout int - timeout in milliseconds (default 2000) + timeout in milliseconds. no timeout when not given -url value Bypass DPI only on this url, can be passed multiple times -v print spoof-dpi's version. this may contain some other relevant information diff --git a/readme_ru.md b/readme_ru.md index 2b376ce..2072581 100644 --- a/readme_ru.md +++ b/readme_ru.md @@ -52,32 +52,31 @@ curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bas ``` Использование: spoof-dpi [опции...] -addr string - адрес (по умолчанию "127.0.0.1") + listen address (default "127.0.0.1") -debug - включает режим отладки + enable debug output -dns-addr string - адрес DNS (по умолчанию "8.8.8.8") + dns address (default "8.8.8.8") -dns-port int - порт DNS сервера (по умолчанию 53) + port number for dns (default 53) -enable-doh - включает 'dns over https' + enable 'dns over https' -no-banner - выключает баннер + disable banner -pattern string - обходить DPI только на пакетах с указанным regex + bypass DPI only on packets matching this regex pattern -port int - порт (по умолчанию 8080) + port (default 8080) -timeout int - таймаут в миллисекундах (по умолчанию 2000) + timeout in milliseconds. no timeout when not given -url value - обходить DPI только на указанном URL, опцию можно указывать несколько раз - -v выводит версию spoof-dpi. может содержать другую полезную информацию + Bypass DPI only on this url, can be passed multiple times + -v print spoof-dpi's version. this may contain some other relevant information -window-size int - размер чанка в байтах для фрагментации client hello, - если не работает по умолчанию, можно попробовать значения меньше; - при 0 используется старый (до v0.10.0) метод разделения client hello: - фрагментация для первого дата пакета и остальных (по умолчанию 50) - + chunk size, in number of bytes, for fragmented client hello, + try lower values if the default value doesn't bypass the DPI; + set to 0 to use old (pre v0.10.0) client hello splitting method: + fragmentation for the first data packet and the rest (default 50) ``` > Если Вы используете любые VPN-расширения по типу Hotspot Shield в браузере Chrome, зайдите в Настройки > Расширения и отключите их. diff --git a/readme_zh-cn.md b/readme_zh-cn.md index 74b8ebe..600e61f 100644 --- a/readme_zh-cn.md +++ b/readme_zh-cn.md @@ -71,7 +71,7 @@ Usage: spoof-dpi [options...] -port int port (default 8080) -timeout int - timeout in milliseconds (default 2000) + timeout in milliseconds. no timeout when not given -url value Bypass DPI only on this url, can be passed multiple times -v print spoof-dpi's version. this may contain some other relevant information diff --git a/util/config.go b/util/config.go index cad89be..2af2f85 100644 --- a/util/config.go +++ b/util/config.go @@ -54,7 +54,7 @@ func ParseArgs() { config.EnableDoh = flag.Bool("enable-doh", false, "enable 'dns over https'") config.Debug = flag.Bool("debug", false, "enable debug output") config.NoBanner = flag.Bool("no-banner", false, "disable banner") - config.Timeout = flag.Int("timeout", 2000, "timeout in milliseconds") + config.Timeout = flag.Int("timeout", 0, "timeout in milliseconds. no timeout when not given") config.WindowSize = flag.Int("window-size", 50, `chunk size, in number of bytes, for fragmented client hello, try lower values if the default value doesn't bypass the DPI; set to 0 to use old (pre v0.10.0) client hello splitting method: @@ -67,7 +67,6 @@ fragmentation for the first data packet and the rest`) ) config.Version = flag.Bool("v", false, "print spoof-dpi's version. this may contain some other relevant information") - flag.Parse() if len(allowedHosts) > 0 {