diff --git a/README.md b/README.md index b8201a4..23a0497 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ glider -config CONFIGPATH -listen :8080 -verbose ## Usage ```bash -glider v0.7.0 usage: +glider 0.8.0 usage: -checkinterval int proxy check interval(seconds) (default 30) -checktimeout int diff --git a/dns/client.go b/dns/client.go index 9b69467..d94fd03 100644 --- a/dns/client.go +++ b/dns/client.go @@ -123,13 +123,15 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([ } // exchange choose a upstream dns server based on qname, communicate with it on the network. -func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (server, network, dialerAddr string, respBytes []byte, err error) { +func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) ( + server, network, dialerAddr string, respBytes []byte, err error) { + // use tcp to connect upstream server default network = "tcp" dialer := c.proxy.NextDialer(qname + ":53") // if we are resolving the dialer's domain, then use Direct to avoid denpency loop - // TODO: dialer.Addr() == "reject", tricky + // TODO: dialer.Addr() == "REJECT", tricky if strings.Contains(dialer.Addr(), qname) || dialer.Addr() == "REJECT" { dialer = proxy.Default } diff --git a/main.go b/main.go index 5a2ae47..2bc2b6d 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ import ( _ "github.com/nadoo/glider/proxy/ws" ) -var version = "dev" +var version = "0.8.0" func main() { // read configs diff --git a/rule/config.go b/rule/config.go index 0862d4d..68efc92 100644 --- a/rule/config.go +++ b/rule/config.go @@ -13,7 +13,7 @@ import ( // Config , every rule dialer points to a rule file type Config struct { - name string + Name string Forward []string StrategyConfig strategy.Config @@ -28,7 +28,7 @@ type Config struct { // NewConfFromFile . func NewConfFromFile(ruleFile string) (*Config, error) { - p := &Config{name: ruleFile} + p := &Config{Name: ruleFile} f := conflag.NewFromFile("rule", ruleFile) f.StringSliceUniqVar(&p.Forward, "forward", nil, "forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]")