feat: adding smart dialer options compatible with outline-sdk parameters

This commit is contained in:
WendelHime 2025-02-28 13:00:05 -03:00
parent eb07c7a79e
commit ca78520e6a

51
option/smart_dialer.go Normal file
View File

@ -0,0 +1,51 @@
package option
// SmartDialerOutboundOptions set the outbound options used by the outline-sdk
// smart dialer. You can find more details about the parameters by looking
// through the implementation: https://github.com/Jigsaw-Code/outline-sdk/blob/v0.0.18/x/smart/stream_dialer.go#L65-L100
// Or check the documentation README: https://github.com/Jigsaw-Code/outline-sdk/tree/v0.0.18/x/smart
type SmartDialerOutboundOptions struct {
DialerOptions
DNSResolvers []DNSEntryConfig `json:"dns,omitempty"`
TLS []string `json:"tls,omitempty"`
}
// DNSEntryConfig specifies a list of resolvers to test and they can be one of
// the attributes (system, https, tls, udp or tcp)
type DNSEntryConfig struct {
// System is used for using the system as a resolver, if you want to use it
// provide an empty object.
System *struct{} `json:"system,omitempty"`
// HTTPS use an encrypted DNS over HTTPS (DoH) resolver.
HTTPS *HTTPSEntryConfig `json:"https,omitempty"`
// TLS use an encrypted DNS over TLS (DoT) resolver.
TLS *TLSEntryConfig `json:"tls,omitempty"`
// UDP use a UDP resolver
UDP *UDPEntryConfig `json:"udp,omitempty"`
// TCP use a TCP resolver
TCP *TCPEntryConfig `json:"tcp,omitempty"`
}
type HTTPSEntryConfig struct {
// Domain name of the host.
Name string `json:"name,omitempty"`
// Host:port. Defaults to Name:443.
Address string `json:"address,omitempty"`
}
type TLSEntryConfig struct {
// Domain name of the host.
Name string `json:"name,omitempty"`
// Host:port. Defaults to Name:853.
Address string `json:"address,omitempty"`
}
type UDPEntryConfig struct {
// Host:port.
Address string `json:"address,omitempty"`
}
type TCPEntryConfig struct {
// Host:port.
Address string `json:"address,omitempty"`
}