mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 14:26:31 +00:00
Release 0.10.11 (#195)
* chore: increase the length of traceId token * fix: size of string builder for trace id * chore: rename --no-banner to --banner * chore: update docs * chore: prepare for next release
This commit is contained in:
parent
d397d30fb5
commit
f8f740b0cf
@ -59,6 +59,8 @@ $ go build ./cmd/...
|
||||
Usage: spoof-dpi [options...]
|
||||
-addr string
|
||||
listen address (default "127.0.0.1")
|
||||
-banner
|
||||
enable banner (default true)
|
||||
-debug
|
||||
enable debug output
|
||||
-dns-addr string
|
||||
@ -67,8 +69,6 @@ Usage: spoof-dpi [options...]
|
||||
port number for dns (default 53)
|
||||
-enable-doh
|
||||
enable 'dns-over-https'
|
||||
-no-banner
|
||||
disable banner
|
||||
-pattern value
|
||||
bypass DPI only on packets matching this regex pattern; can be given multiple times
|
||||
-port int
|
||||
|
@ -56,6 +56,8 @@ $ go build ./cmd/...
|
||||
Usage: spoof-dpi [options...]
|
||||
-addr string
|
||||
listen address (default "127.0.0.1")
|
||||
-banner
|
||||
enable banner (default true)
|
||||
-debug
|
||||
enable debug output
|
||||
-dns-addr string
|
||||
@ -64,8 +66,6 @@ Usage: spoof-dpi [options...]
|
||||
port number for dns (default 53)
|
||||
-enable-doh
|
||||
enable 'dns-over-https'
|
||||
-no-banner
|
||||
disable banner
|
||||
-pattern value
|
||||
bypass DPI only on packets matching this regex pattern; can be given multiple times
|
||||
-port int
|
||||
|
@ -54,6 +54,8 @@ $ go install github.com/xvzc/SpoofDPI/cmd/spoof-dpi@latest
|
||||
Usage: spoof-dpi [options...]
|
||||
-addr string
|
||||
listen address (default "127.0.0.1")
|
||||
-banner
|
||||
enable banner (default true)
|
||||
-debug
|
||||
enable debug output
|
||||
-dns-addr string
|
||||
@ -62,8 +64,6 @@ Usage: spoof-dpi [options...]
|
||||
port number for dns (default 53)
|
||||
-enable-doh
|
||||
enable 'dns-over-https'
|
||||
-no-banner
|
||||
disable banner
|
||||
-pattern value
|
||||
bypass DPI only on packets matching this regex pattern; can be given multiple times
|
||||
-port int
|
||||
|
@ -58,6 +58,8 @@ $ go build ./cmd/...
|
||||
Usage: spoof-dpi [опции...]
|
||||
-addr string
|
||||
listen address (default "127.0.0.1")
|
||||
-banner
|
||||
enable banner (default true)
|
||||
-debug
|
||||
enable debug output
|
||||
-dns-addr string
|
||||
@ -66,8 +68,6 @@ Usage: spoof-dpi [опции...]
|
||||
port number for dns (default 53)
|
||||
-enable-doh
|
||||
enable 'dns-over-https'
|
||||
-no-banner
|
||||
disable banner
|
||||
-pattern value
|
||||
bypass DPI only on packets matching this regex pattern; can be given multiple times
|
||||
-port int
|
||||
|
@ -63,6 +63,8 @@ $ go build ./cmd/...
|
||||
Usage: spoof-dpi [options...]
|
||||
-addr string
|
||||
listen address (default "127.0.0.1")
|
||||
-banner
|
||||
enable banner (default true)
|
||||
-debug
|
||||
enable debug output
|
||||
-dns-addr string
|
||||
@ -71,8 +73,6 @@ Usage: spoof-dpi [options...]
|
||||
port number for dns (default 53)
|
||||
-enable-doh
|
||||
enable 'dns-over-https'
|
||||
-no-banner
|
||||
disable banner
|
||||
-pattern value
|
||||
bypass DPI only on packets matching this regex pattern; can be given multiple times
|
||||
-port int
|
||||
|
@ -29,10 +29,10 @@ func main() {
|
||||
|
||||
pxy := proxy.New(config)
|
||||
|
||||
if config.NoBanner {
|
||||
util.PrintSimpleInfo()
|
||||
} else {
|
||||
if config.Banner {
|
||||
util.PrintColoredBanner()
|
||||
} else {
|
||||
util.PrintSimpleInfo()
|
||||
}
|
||||
|
||||
if config.SystemProxy {
|
||||
|
@ -12,7 +12,7 @@ type Args struct {
|
||||
DnsPort int
|
||||
EnableDoh bool
|
||||
Debug bool
|
||||
NoBanner bool
|
||||
Banner bool
|
||||
SystemProxy bool
|
||||
Timeout int
|
||||
AllowedPattern StringArray
|
||||
@ -40,7 +40,7 @@ func ParseArgs() *Args {
|
||||
flag.IntVar(&args.DnsPort, "dns-port", 53, "port number for dns")
|
||||
flag.BoolVar(&args.EnableDoh, "enable-doh", false, "enable 'dns-over-https'")
|
||||
flag.BoolVar(&args.Debug, "debug", false, "enable debug output")
|
||||
flag.BoolVar(&args.NoBanner, "no-banner", false, "disable banner")
|
||||
flag.BoolVar(&args.Banner, "banner", true, "enable banner")
|
||||
flag.BoolVar(&args.SystemProxy, "system-proxy", true, "enable system-wide proxy")
|
||||
flag.IntVar(&args.Timeout, "timeout", 0, "timeout in milliseconds; no timeout when not given")
|
||||
flag.IntVar(&args.WindowSize, "window-size", 0, `chunk size, in number of bytes, for fragmented client hello,
|
||||
|
@ -15,7 +15,7 @@ type Config struct {
|
||||
DnsPort int
|
||||
EnableDoh bool
|
||||
Debug bool
|
||||
NoBanner bool
|
||||
Banner bool
|
||||
SystemProxy bool
|
||||
Timeout int
|
||||
WindowSize int
|
||||
@ -38,7 +38,7 @@ func (c *Config) Load(args *Args) {
|
||||
c.DnsPort = args.DnsPort
|
||||
c.Debug = args.Debug
|
||||
c.EnableDoh = args.EnableDoh
|
||||
c.NoBanner = args.NoBanner
|
||||
c.Banner = args.Banner
|
||||
c.SystemProxy = args.SystemProxy
|
||||
c.Timeout = args.Timeout
|
||||
c.AllowedPatterns = parseAllowedPattern(args.AllowedPattern)
|
||||
@ -66,6 +66,8 @@ func PrintColoredBanner() {
|
||||
{Level: 0, Text: "DNS : " + fmt.Sprint(config.DnsAddr)},
|
||||
{Level: 0, Text: "DEBUG : " + fmt.Sprint(config.Debug)},
|
||||
}).Render()
|
||||
|
||||
pterm.DefaultBasicText.Println("Press 'CTRL + c to quit'")
|
||||
}
|
||||
|
||||
func PrintSimpleInfo() {
|
||||
@ -75,4 +77,6 @@ func PrintSimpleInfo() {
|
||||
fmt.Println("- DNS : ", config.DnsAddr)
|
||||
fmt.Println("- DEBUG : ", config.Debug)
|
||||
fmt.Println("")
|
||||
fmt.Println("Press 'CTRL + c to quit'")
|
||||
fmt.Println("")
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ func GetTraceIdFromCtx(ctx context.Context) (string, bool) {
|
||||
|
||||
func generateTraceId() string {
|
||||
sb := strings.Builder{}
|
||||
sb.Grow(22)
|
||||
sb.Grow(35)
|
||||
|
||||
var q uint64
|
||||
var r uint8
|
||||
@ -47,7 +47,7 @@ func generateTraceId() string {
|
||||
r += 0x27
|
||||
}
|
||||
sb.WriteByte(r + 0x30)
|
||||
if i&3 == 3 && i != 31 {
|
||||
if i&7 == 7 && i != 31 {
|
||||
sb.WriteByte(0x2D)
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
0.10.10
|
||||
0.10.11
|
||||
|
Loading…
Reference in New Issue
Block a user