mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-11 17:47:20 +10:00
27 lines
692 B
Go
27 lines
692 B
Go
package dns
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sagernet/sing-box/common/dialer"
|
|
"github.com/sagernet/sing-box/option"
|
|
N "github.com/sagernet/sing/common/network"
|
|
)
|
|
|
|
func NewLocalDialer(ctx context.Context, options option.LocalDNSServerOptions) (N.Dialer, error) {
|
|
return dialer.NewWithOptions(dialer.Options{
|
|
Context: ctx,
|
|
Options: options.DialerOptions,
|
|
DirectResolver: true,
|
|
})
|
|
}
|
|
|
|
func NewRemoteDialer(ctx context.Context, options option.RemoteDNSServerOptions) (N.Dialer, error) {
|
|
return dialer.NewWithOptions(dialer.Options{
|
|
Context: ctx,
|
|
Options: options.DialerOptions,
|
|
RemoteIsDomain: options.ServerIsDomain(),
|
|
DirectResolver: true,
|
|
})
|
|
}
|