mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-11 17:47:20 +10:00
Refactor bind control
This commit is contained in:
7
include/quic.go
Normal file
7
include/quic.go
Normal file
@@ -0,0 +1,7 @@
|
||||
//go:build with_quic
|
||||
|
||||
package include
|
||||
|
||||
import _ "github.com/sagernet/sing-dns/quic"
|
||||
|
||||
const WithQUIC = true
|
||||
21
include/quic_stub.go
Normal file
21
include/quic_stub.go
Normal file
@@ -0,0 +1,21 @@
|
||||
//go:build !with_quic
|
||||
|
||||
package include
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/sagernet/sing-dns"
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
N "github.com/sagernet/sing/common/network"
|
||||
)
|
||||
|
||||
const WithQUIC = false
|
||||
|
||||
var ErrQUICNotIncluded = E.New(`QUIC is not included in this build, rebuild with -tags with_quic`)
|
||||
|
||||
func init() {
|
||||
dns.RegisterTransport([]string{"quic", "h3"}, func(ctx context.Context, dialer N.Dialer, link string) (dns.Transport, error) {
|
||||
return nil, ErrQUICNotIncluded
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user