mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 22:36:53 +00:00
commit
d84dff0674
@ -176,11 +176,9 @@ func (from *Conn) Serve(to *Conn, proto string, fd string, td string, timeout in
|
|||||||
proto += " "
|
proto += " "
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if timeout > 0 {
|
|
||||||
from.SetReadDeadline(
|
from.SetReadDeadline(
|
||||||
time.Now().Add(time.Millisecond * time.Duration(timeout)),
|
time.Now().Add(time.Millisecond * time.Duration(timeout)),
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
buf, err := from.ReadBytes()
|
buf, err := from.ReadBytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -39,9 +39,7 @@ func (p *Proxy) Start() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.timeout > 0 {
|
|
||||||
log.Println(fmt.Sprintf("Connection timeout is set to %dms", p.timeout))
|
log.Println(fmt.Sprintf("Connection timeout is set to %dms", p.timeout))
|
||||||
}
|
|
||||||
|
|
||||||
log.Println("Created a listener on port", p.Port())
|
log.Println("Created a listener on port", p.Port())
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ func ParseArgs() {
|
|||||||
config.Dns = flag.String("dns", "8.8.8.8", "DNS server")
|
config.Dns = flag.String("dns", "8.8.8.8", "DNS server")
|
||||||
config.Debug = flag.Bool("debug", false, "true | false")
|
config.Debug = flag.Bool("debug", false, "true | false")
|
||||||
config.NoBanner = flag.Bool("no-banner", false, "true | false")
|
config.NoBanner = flag.Bool("no-banner", false, "true | false")
|
||||||
config.Timeout = flag.Int("timeout", 0, "timeout in milliseconds")
|
config.Timeout = flag.Int("timeout", 2000, "timeout in milliseconds")
|
||||||
|
|
||||||
flag.Var(&allowedHosts, "url", "Bypass DPI only on this url, can be passed multiple times")
|
flag.Var(&allowedHosts, "url", "Bypass DPI only on this url, can be passed multiple times")
|
||||||
allowedPattern = flag.String(
|
allowedPattern = flag.String(
|
||||||
|
Loading…
Reference in New Issue
Block a user