mirror of
https://github.com/fatedier/frp.git
synced 2025-06-17 17:18:21 +00:00
Compare commits
3 Commits
e52019c4e9
...
0ea4edc606
Author | SHA1 | Date | |
---|---|---|---|
|
0ea4edc606 | ||
|
e680acf42d | ||
|
522e2c94c1 |
@ -5,3 +5,4 @@
|
||||
### Changes
|
||||
|
||||
* Updated the default value of `transport.tcpMuxKeepaliveInterval` from 60 to 30.
|
||||
* On the Android platform, the Google DNS server is used only when the default DNS server cannot be obtained.
|
||||
|
@ -17,6 +17,7 @@ package v1
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
@ -42,7 +43,7 @@ func (c *TypedClientPluginOptions) UnmarshalJSON(b []byte) error {
|
||||
|
||||
c.Type = typeStruct.Type
|
||||
if c.Type == "" {
|
||||
return nil
|
||||
return errors.New("plugin type is empty")
|
||||
}
|
||||
|
||||
v, ok := clientPluginOptionsTypeMap[typeStruct.Type]
|
||||
@ -63,6 +64,10 @@ func (c *TypedClientPluginOptions) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *TypedClientPluginOptions) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(c.ClientPluginOptions)
|
||||
}
|
||||
|
||||
const (
|
||||
PluginHTTP2HTTPS = "http2https"
|
||||
PluginHTTPProxy = "http_proxy"
|
||||
|
@ -195,6 +195,10 @@ func (c *TypedProxyConfig) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *TypedProxyConfig) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(c.ProxyConfigurer)
|
||||
}
|
||||
|
||||
type ProxyConfigurer interface {
|
||||
Complete(namePrefix string)
|
||||
GetBaseConfig() *ProxyBaseConfig
|
||||
|
@ -120,6 +120,10 @@ func (c *TypedVisitorConfig) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *TypedVisitorConfig) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(c.VisitorConfigurer)
|
||||
}
|
||||
|
||||
func NewVisitorConfigurerByType(t VisitorType) VisitorConfigurer {
|
||||
v, ok := visitorConfigTypeMap[t]
|
||||
if !ok {
|
||||
|
@ -59,8 +59,12 @@ func fixDNSResolver() {
|
||||
// Note: If there are other methods to obtain the default DNS servers, the default DNS servers should be used preferentially.
|
||||
net.DefaultResolver = &net.Resolver{
|
||||
PreferGo: true,
|
||||
Dial: func(ctx context.Context, network, _ string) (net.Conn, error) {
|
||||
return net.Dial(network, "8.8.8.8:53")
|
||||
Dial: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
if addr == "127.0.0.1:53" || addr == "[::1]:53" {
|
||||
addr = "8.8.8.8:53"
|
||||
}
|
||||
var d net.Dialer
|
||||
return d.DialContext(ctx, network, addr)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user