mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-26 20:29:03 +03:00
Add Snell protocol. Refactor MASQUE HTTP/2, Fair Queue. Update XHTTP, OpenVPN, Sudoku, Fallback. Fixes
This commit is contained in:
@@ -91,6 +91,7 @@ func InboundRegistry() *inbound.Registry {
|
||||
registerStubForRemovedInbounds(registry)
|
||||
registerMTProxyInbound(registry)
|
||||
registerSudokuInbound(registry)
|
||||
registerSnellInbound(registry)
|
||||
|
||||
return registry
|
||||
}
|
||||
@@ -135,6 +136,7 @@ func OutboundRegistry() *outbound.Registry {
|
||||
registerQUICOutbounds(registry)
|
||||
registerStubForRemovedOutbounds(registry)
|
||||
registerSudokuOutbound(registry)
|
||||
registerSnellOutbound(registry)
|
||||
|
||||
return registry
|
||||
}
|
||||
|
||||
17
include/snell.go
Normal file
17
include/snell.go
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build with_snell
|
||||
|
||||
package include
|
||||
|
||||
import (
|
||||
"github.com/sagernet/sing-box/adapter/inbound"
|
||||
"github.com/sagernet/sing-box/adapter/outbound"
|
||||
"github.com/sagernet/sing-box/protocol/snell"
|
||||
)
|
||||
|
||||
func registerSnellInbound(registry *inbound.Registry) {
|
||||
snell.RegisterInbound(registry)
|
||||
}
|
||||
|
||||
func registerSnellOutbound(registry *outbound.Registry) {
|
||||
snell.RegisterOutbound(registry)
|
||||
}
|
||||
27
include/snell_stub.go
Normal file
27
include/snell_stub.go
Normal file
@@ -0,0 +1,27 @@
|
||||
//go:build !with_snell
|
||||
|
||||
package include
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing-box/adapter/inbound"
|
||||
"github.com/sagernet/sing-box/adapter/outbound"
|
||||
C "github.com/sagernet/sing-box/constant"
|
||||
"github.com/sagernet/sing-box/log"
|
||||
"github.com/sagernet/sing-box/option"
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
)
|
||||
|
||||
func registerSnellInbound(registry *inbound.Registry) {
|
||||
inbound.Register[option.SnellInboundOptions](registry, C.TypeSnell, func(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.SnellInboundOptions) (adapter.Inbound, error) {
|
||||
return nil, E.New(`Snell is not included in this build, rebuild with -tags with_snell`)
|
||||
})
|
||||
}
|
||||
|
||||
func registerSnellOutbound(registry *outbound.Registry) {
|
||||
outbound.Register[option.SnellOutboundOptions](registry, C.TypeSnell, func(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.SnellOutboundOptions) (adapter.Outbound, error) {
|
||||
return nil, E.New(`Snell is not included in this build, rebuild with -tags with_snell`)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user