Fix RemoteHTTPSDNSServerOptions

This commit is contained in:
世界
2026-04-14 14:07:17 +08:00
parent c33a2bd3e9
commit ff99457492

View File

@@ -166,6 +166,13 @@ type RemoteTLSDNSServerOptions struct {
OutboundTLSOptionsContainer
}
type _RemoteHTTPSDNSServerOptions struct {
DNSServerAddressOptions
Path string `json:"path,omitempty"`
Method string `json:"method,omitempty"`
_HTTPClientOptions
}
type RemoteHTTPSDNSServerOptions struct {
DNSServerAddressOptions
Path string `json:"path,omitempty"`
@@ -173,6 +180,35 @@ type RemoteHTTPSDNSServerOptions struct {
HTTPClientOptions
}
func (o RemoteHTTPSDNSServerOptions) MarshalJSON() ([]byte, error) {
raw := _RemoteHTTPSDNSServerOptions{
DNSServerAddressOptions: o.DNSServerAddressOptions,
Path: o.Path,
Method: o.Method,
_HTTPClientOptions: _HTTPClientOptions(o.HTTPClientOptions),
}
return badjson.MarshallObjects(raw, httpClientVariant(raw._HTTPClientOptions))
}
func (o *RemoteHTTPSDNSServerOptions) UnmarshalJSON(content []byte) error {
var raw _RemoteHTTPSDNSServerOptions
err := json.Unmarshal(content, &raw)
if err != nil {
return err
}
err = unmarshalHTTPClientVersionOptions(content, &raw, &raw._HTTPClientOptions)
if err != nil {
return err
}
*o = RemoteHTTPSDNSServerOptions{
DNSServerAddressOptions: raw.DNSServerAddressOptions,
Path: raw.Path,
Method: raw.Method,
HTTPClientOptions: HTTPClientOptions(raw._HTTPClientOptions),
}
return nil
}
type FakeIPDNSServerOptions struct {
Inet4Range *badoption.Prefix `json:"inet4_range,omitempty"`
Inet6Range *badoption.Prefix `json:"inet6_range,omitempty"`