mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-15 05:08:33 +10:00
Fix RemoteHTTPSDNSServerOptions
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user