mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-05 17:13:32 +08:00
fix: smux should show its support udp and uot
This commit is contained in:
parent
0c61057551
commit
7f1b7e7521
@ -81,6 +81,20 @@ func (s *SingMux) ListenPacketContext(ctx context.Context, metadata *C.Metadata,
|
|||||||
return newPacketConn(pc, s.ProxyAdapter), nil
|
return newPacketConn(pc, s.ProxyAdapter), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *SingMux) SupportUDP() bool {
|
||||||
|
if s.onlyTcp {
|
||||||
|
return s.ProxyAdapter.SupportUOT()
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SingMux) SupportUOT() bool {
|
||||||
|
if s.onlyTcp {
|
||||||
|
return s.ProxyAdapter.SupportUOT()
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func NewSingMux(option SingMuxOption, proxy C.ProxyAdapter, base ProxyBase) (C.ProxyAdapter, error) {
|
func NewSingMux(option SingMuxOption, proxy C.ProxyAdapter, base ProxyBase) (C.ProxyAdapter, error) {
|
||||||
singDialer := &muxSingDialer{dialer: dialer.NewDialer(), proxy: proxy, statistic: option.Statistic}
|
singDialer := &muxSingDialer{dialer: dialer.NewDialer(), proxy: proxy, statistic: option.Statistic}
|
||||||
client, err := mux.NewClient(mux.Options{
|
client, err := mux.NewClient(mux.Options{
|
||||||
|
@ -92,7 +92,7 @@ func (r *Relay) SupportUDP() bool {
|
|||||||
switch proxy.SupportWithDialer() {
|
switch proxy.SupportWithDialer() {
|
||||||
case C.ALLNet:
|
case C.ALLNet:
|
||||||
case C.UDP:
|
case C.UDP:
|
||||||
default: // C.TCP and C.NONet
|
default: // C.TCP and C.InvalidNet
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user