mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-20 18:02:11 +03:00
Add admin panel, manager, node_manager, bandwidth limiter, connection limiter, bonding, failover, vless encryption, mkcp transport
This commit is contained in:
@@ -15,8 +15,8 @@ import (
|
||||
C "github.com/sagernet/sing-box/constant"
|
||||
"github.com/sagernet/sing-box/option"
|
||||
R "github.com/sagernet/sing-box/route/rule"
|
||||
"github.com/sagernet/sing-mux"
|
||||
"github.com/sagernet/sing-vmess"
|
||||
mux "github.com/sagernet/sing-mux"
|
||||
vmess "github.com/sagernet/sing-vmess"
|
||||
"github.com/sagernet/sing/common"
|
||||
"github.com/sagernet/sing/common/buf"
|
||||
"github.com/sagernet/sing/common/bufio"
|
||||
@@ -123,12 +123,11 @@ func (r *Router) routeConnection(ctx context.Context, conn net.Conn, metadata ad
|
||||
}
|
||||
}
|
||||
if selectedRule == nil {
|
||||
defaultOutbound := r.outbound.Default()
|
||||
if !common.Contains(defaultOutbound.Network(), N.NetworkTCP) {
|
||||
if !common.Contains(r.defaultOutbound.Network(), N.NetworkTCP) {
|
||||
buf.ReleaseMulti(buffers)
|
||||
return E.New("TCP is not supported by default outbound: ", defaultOutbound.Tag())
|
||||
return E.New("TCP is not supported by default outbound: ", r.defaultOutbound.Tag())
|
||||
}
|
||||
selectedOutbound = defaultOutbound
|
||||
selectedOutbound = r.defaultOutbound
|
||||
}
|
||||
|
||||
for _, buffer := range buffers {
|
||||
@@ -234,12 +233,11 @@ func (r *Router) routePacketConnection(ctx context.Context, conn N.PacketConn, m
|
||||
}
|
||||
}
|
||||
if selectedRule == nil || selectReturn {
|
||||
defaultOutbound := r.outbound.Default()
|
||||
if !common.Contains(defaultOutbound.Network(), N.NetworkUDP) {
|
||||
if !common.Contains(r.defaultOutbound.Network(), N.NetworkUDP) {
|
||||
N.ReleaseMultiPacketBuffer(packetBuffers)
|
||||
return E.New("UDP is not supported by outbound: ", defaultOutbound.Tag())
|
||||
return E.New("UDP is not supported by outbound: ", r.defaultOutbound.Tag())
|
||||
}
|
||||
selectedOutbound = defaultOutbound
|
||||
selectedOutbound = r.defaultOutbound
|
||||
}
|
||||
for _, buffer := range packetBuffers {
|
||||
conn = bufio.NewCachedPacketConn(conn, buffer.Buffer, buffer.Destination)
|
||||
|
||||
Reference in New Issue
Block a user