chore: wireguard dns can work with domain-based server
This commit is contained in:
@ -93,6 +93,11 @@ func (b *Base) SupportTFO() bool {
|
||||
return b.tfo
|
||||
}
|
||||
|
||||
// IsL3Protocol implements C.ProxyAdapter
|
||||
func (b *Base) IsL3Protocol(metadata *C.Metadata) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// MarshalJSON implements C.ProxyAdapter
|
||||
func (b *Base) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(map[string]string{
|
||||
|
@ -401,3 +401,8 @@ func (w *WireGuard) ListenPacketContext(ctx context.Context, metadata *C.Metadat
|
||||
}
|
||||
return newPacketConn(CN.NewRefPacketConn(pc, w), w), nil
|
||||
}
|
||||
|
||||
// IsL3Protocol implements C.ProxyAdapter
|
||||
func (w *WireGuard) IsL3Protocol(metadata *C.Metadata) bool {
|
||||
return true
|
||||
}
|
||||
|
@ -70,6 +70,11 @@ func (f *Fallback) SupportUDP() bool {
|
||||
return proxy.SupportUDP()
|
||||
}
|
||||
|
||||
// IsL3Protocol implements C.ProxyAdapter
|
||||
func (f *Fallback) IsL3Protocol(metadata *C.Metadata) bool {
|
||||
return f.findAliveProxy(false).IsL3Protocol(metadata)
|
||||
}
|
||||
|
||||
// MarshalJSON implements C.ProxyAdapter
|
||||
func (f *Fallback) MarshalJSON() ([]byte, error) {
|
||||
all := []string{}
|
||||
|
@ -124,6 +124,11 @@ func (lb *LoadBalance) SupportUDP() bool {
|
||||
return !lb.disableUDP
|
||||
}
|
||||
|
||||
// IsL3Protocol implements C.ProxyAdapter
|
||||
func (lb *LoadBalance) IsL3Protocol(metadata *C.Metadata) bool {
|
||||
return lb.Unwrap(metadata, false).IsL3Protocol(metadata)
|
||||
}
|
||||
|
||||
func strategyRoundRobin() strategyFn {
|
||||
idx := 0
|
||||
idxMutex := sync.Mutex{}
|
||||
|
@ -44,6 +44,11 @@ func (s *Selector) SupportUDP() bool {
|
||||
return s.selectedProxy(false).SupportUDP()
|
||||
}
|
||||
|
||||
// IsL3Protocol implements C.ProxyAdapter
|
||||
func (s *Selector) IsL3Protocol(metadata *C.Metadata) bool {
|
||||
return s.selectedProxy(false).IsL3Protocol(metadata)
|
||||
}
|
||||
|
||||
// MarshalJSON implements C.ProxyAdapter
|
||||
func (s *Selector) MarshalJSON() ([]byte, error) {
|
||||
all := []string{}
|
||||
|
@ -147,6 +147,11 @@ func (u *URLTest) SupportUDP() bool {
|
||||
return u.fast(false).SupportUDP()
|
||||
}
|
||||
|
||||
// IsL3Protocol implements C.ProxyAdapter
|
||||
func (u *URLTest) IsL3Protocol(metadata *C.Metadata) bool {
|
||||
return u.fast(false).IsL3Protocol(metadata)
|
||||
}
|
||||
|
||||
// MarshalJSON implements C.ProxyAdapter
|
||||
func (u *URLTest) MarshalJSON() ([]byte, error) {
|
||||
all := []string{}
|
||||
|
Reference in New Issue
Block a user