Feature: bind socket to interface by native API on Windows (#2662)

This commit is contained in:
yaling888
2023-04-08 19:20:14 +08:00
committed by GitHub
parent 95bbfe3945
commit 20a521f02d
6 changed files with 224 additions and 50 deletions

View File

@ -10,6 +10,7 @@ var (
type option struct {
interfaceName string
fallbackBind bool
addrReuse bool
routingMark int
}
@ -22,6 +23,12 @@ func WithInterface(name string) Option {
}
}
func WithFallbackBind(fallback bool) Option {
return func(opt *option) {
opt.fallbackBind = fallback
}
}
func WithAddrReuse(reuse bool) Option {
return func(opt *option) {
opt.addrReuse = reuse