mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-01-03 04:50:11 +00:00
remove timeout when not given
This commit is contained in:
parent
6e7319e2ac
commit
2069f3b9d8
@ -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 &&
|
||||
|
@ -57,9 +57,11 @@ func Serve(from *net.TCPConn, to *net.TCPConn, proto string, fd string, td strin
|
||||
proto += " "
|
||||
|
||||
for {
|
||||
if timeout > 0 {
|
||||
from.SetReadDeadline(
|
||||
time.Now().Add(time.Millisecond * time.Duration(timeout)),
|
||||
)
|
||||
}
|
||||
|
||||
buf, err := ReadBytes(from)
|
||||
if err != nil {
|
||||
|
@ -42,7 +42,9 @@ func (pxy *Proxy) Start() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
31
readme_ru.md
31
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, зайдите в Настройки > Расширения и отключите их.
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user