Refactor bind control

This commit is contained in:
世界
2022-09-14 12:46:02 +08:00
parent 61b364738c
commit c7d3f264c9
16 changed files with 123 additions and 62 deletions

View File

@@ -6,11 +6,11 @@ import (
"context"
"github.com/sagernet/sing-box/adapter"
C "github.com/sagernet/sing-box/constant"
I "github.com/sagernet/sing-box/include"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
)
func NewHysteria(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.HysteriaInboundOptions) (adapter.Inbound, error) {
return nil, C.ErrQUICNotIncluded
return nil, I.ErrQUICNotIncluded
}

View File

@@ -15,6 +15,7 @@ import (
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/tls"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/include"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common"
@@ -105,7 +106,7 @@ func (n *Naive) Start() error {
if common.Contains(n.network, N.NetworkUDP) {
err := n.configureHTTP3Listener()
if !C.QUIC_AVAILABLE && len(n.network) > 1 {
if !include.WithQUIC && len(n.network) > 1 {
log.Warn(E.Cause(err, "naive http3 disabled"))
} else if err != nil {
return err

View File

@@ -3,9 +3,9 @@
package inbound
import (
C "github.com/sagernet/sing-box/constant"
I "github.com/sagernet/sing-box/include"
)
func (n *Naive) configureHTTP3Listener() error {
return C.ErrQUICNotIncluded
return I.ErrQUICNotIncluded
}