mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
dnstun: remove last dot in getDomain func
This commit is contained in:
parent
8cb0672df0
commit
7a919ed124
@ -118,5 +118,7 @@ func getDomain(p []byte) []byte {
|
|||||||
i = i + l + 1
|
i = i + l + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
// TODO: check here
|
||||||
|
// domain name could not be null, so the length of ret always >= 1?
|
||||||
|
return ret[:len(ret)-1]
|
||||||
}
|
}
|
||||||
|
2
main.go
2
main.go
@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// VERSION .
|
// VERSION .
|
||||||
const VERSION = "0.3.1"
|
const VERSION = "0.4.0"
|
||||||
|
|
||||||
var conf struct {
|
var conf struct {
|
||||||
Verbose bool
|
Verbose bool
|
||||||
|
2
proxy.go
2
proxy.go
@ -24,7 +24,7 @@ type Proxy interface {
|
|||||||
// Get current proxy
|
// Get current proxy
|
||||||
CurrentProxy() Proxy
|
CurrentProxy() Proxy
|
||||||
|
|
||||||
// Get a proxy according to the strategy
|
// Get a proxy based on the destAddr and strategy
|
||||||
GetProxy(dstAddr string) Proxy
|
GetProxy(dstAddr string) Proxy
|
||||||
|
|
||||||
// Switch to the next proxy
|
// Switch to the next proxy
|
||||||
|
@ -4,14 +4,14 @@ package main
|
|||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
|
|
||||||
type redir struct{ Proxy }
|
type redir struct{ *proxy }
|
||||||
|
|
||||||
// RedirProxy returns a redirect proxy.
|
// RedirProxy returns a redirect proxy.
|
||||||
func RedirProxy(addr string, upProxy Proxy) (Proxy, error) {
|
func RedirProxy(addr string, upProxy Proxy) (Proxy, error) {
|
||||||
return &redir{Proxy: upProxy}, nil
|
return &redir{proxy: newProxy(addr, upProxy)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListenAndServe redirected requests as a server.
|
// ListenAndServe redirected requests as a server.
|
||||||
func (s *redir) ListenAndServe() {
|
func (s *redir) ListenAndServe() {
|
||||||
log.Fatal("redir not supported on windows")
|
log.Fatal("redir not supported on this os")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user