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
|
#!/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
|
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 &&
|
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 += " "
|
proto += " "
|
||||||
|
|
||||||
for {
|
for {
|
||||||
from.SetReadDeadline(
|
if timeout > 0 {
|
||||||
time.Now().Add(time.Millisecond * time.Duration(timeout)),
|
from.SetReadDeadline(
|
||||||
)
|
time.Now().Add(time.Millisecond * time.Duration(timeout)),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
buf, err := ReadBytes(from)
|
buf, err := ReadBytes(from)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -42,7 +42,9 @@ func (pxy *Proxy) Start() {
|
|||||||
os.Exit(1)
|
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)
|
log.Println("[PROXY] Created a listener on port", pxy.port)
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ Usage: spoof-dpi [options...]
|
|||||||
-port int
|
-port int
|
||||||
port (default 8080)
|
port (default 8080)
|
||||||
-timeout int
|
-timeout int
|
||||||
timeout in milliseconds (default 2000)
|
timeout in milliseconds. no timeout when not given
|
||||||
-url value
|
-url value
|
||||||
Bypass DPI only on this url, can be passed multiple times
|
Bypass DPI only on this url, can be passed multiple times
|
||||||
-v print spoof-dpi's version. this may contain some other relevant information
|
-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;
|
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:
|
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)
|
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,
|
> If you are using any vpn extensions such as Hotspot Shield in Chrome browser,
|
||||||
go to Settings > Extensions, and disable them.
|
go to Settings > Extensions, and disable them.
|
||||||
|
@ -68,7 +68,7 @@ Usage: spoof-dpi [options...]
|
|||||||
-port int
|
-port int
|
||||||
port (default 8080)
|
port (default 8080)
|
||||||
-timeout int
|
-timeout int
|
||||||
timeout in milliseconds (default 2000)
|
timeout in milliseconds. no timeout when not given
|
||||||
-url value
|
-url value
|
||||||
Bypass DPI only on this url, can be passed multiple times
|
Bypass DPI only on this url, can be passed multiple times
|
||||||
-v print spoof-dpi's version. this may contain some other relevant information
|
-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 [опции...]
|
Использование: spoof-dpi [опции...]
|
||||||
-addr string
|
-addr string
|
||||||
адрес (по умолчанию "127.0.0.1")
|
listen address (default "127.0.0.1")
|
||||||
-debug
|
-debug
|
||||||
включает режим отладки
|
enable debug output
|
||||||
-dns-addr string
|
-dns-addr string
|
||||||
адрес DNS (по умолчанию "8.8.8.8")
|
dns address (default "8.8.8.8")
|
||||||
-dns-port int
|
-dns-port int
|
||||||
порт DNS сервера (по умолчанию 53)
|
port number for dns (default 53)
|
||||||
-enable-doh
|
-enable-doh
|
||||||
включает 'dns over https'
|
enable 'dns over https'
|
||||||
-no-banner
|
-no-banner
|
||||||
выключает баннер
|
disable banner
|
||||||
-pattern string
|
-pattern string
|
||||||
обходить DPI только на пакетах с указанным regex
|
bypass DPI only on packets matching this regex pattern
|
||||||
-port int
|
-port int
|
||||||
порт (по умолчанию 8080)
|
port (default 8080)
|
||||||
-timeout int
|
-timeout int
|
||||||
таймаут в миллисекундах (по умолчанию 2000)
|
timeout in milliseconds. no timeout when not given
|
||||||
-url value
|
-url value
|
||||||
обходить DPI только на указанном URL, опцию можно указывать несколько раз
|
Bypass DPI only on this url, can be passed multiple times
|
||||||
-v выводит версию spoof-dpi. может содержать другую полезную информацию
|
-v print spoof-dpi's version. this may contain some other relevant information
|
||||||
-window-size int
|
-window-size int
|
||||||
размер чанка в байтах для фрагментации client hello,
|
chunk size, in number of bytes, for fragmented client hello,
|
||||||
если не работает по умолчанию, можно попробовать значения меньше;
|
try lower values if the default value doesn't bypass the DPI;
|
||||||
при 0 используется старый (до v0.10.0) метод разделения client hello:
|
set to 0 to use old (pre v0.10.0) client hello splitting method:
|
||||||
фрагментация для первого дата пакета и остальных (по умолчанию 50)
|
fragmentation for the first data packet and the rest (default 50)
|
||||||
|
|
||||||
```
|
```
|
||||||
> Если Вы используете любые VPN-расширения по типу Hotspot Shield в браузере
|
> Если Вы используете любые VPN-расширения по типу Hotspot Shield в браузере
|
||||||
Chrome, зайдите в Настройки > Расширения и отключите их.
|
Chrome, зайдите в Настройки > Расширения и отключите их.
|
||||||
|
@ -71,7 +71,7 @@ Usage: spoof-dpi [options...]
|
|||||||
-port int
|
-port int
|
||||||
port (default 8080)
|
port (default 8080)
|
||||||
-timeout int
|
-timeout int
|
||||||
timeout in milliseconds (default 2000)
|
timeout in milliseconds. no timeout when not given
|
||||||
-url value
|
-url value
|
||||||
Bypass DPI only on this url, can be passed multiple times
|
Bypass DPI only on this url, can be passed multiple times
|
||||||
-v print spoof-dpi's version. this may contain some other relevant information
|
-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.EnableDoh = flag.Bool("enable-doh", false, "enable 'dns over https'")
|
||||||
config.Debug = flag.Bool("debug", false, "enable debug output")
|
config.Debug = flag.Bool("debug", false, "enable debug output")
|
||||||
config.NoBanner = flag.Bool("no-banner", false, "disable banner")
|
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,
|
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;
|
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:
|
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")
|
config.Version = flag.Bool("v", false, "print spoof-dpi's version. this may contain some other relevant information")
|
||||||
|
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if len(allowedHosts) > 0 {
|
if len(allowedHosts) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user