add socks
This commit is contained in:
@ -8,7 +8,11 @@ func (c *Chain) AddNodeGroup(group *NodeGroup) {
|
||||
c.groups = append(c.groups, group)
|
||||
}
|
||||
|
||||
func (c *Chain) GetRouteFor(addr string) (r *Route) {
|
||||
func (c *Chain) GetRoute() (r *Route) {
|
||||
return c.GetRouteFor("tcp", "")
|
||||
}
|
||||
|
||||
func (c *Chain) GetRouteFor(network, address string) (r *Route) {
|
||||
if c == nil || len(c.groups) == 0 {
|
||||
return
|
||||
}
|
||||
@ -19,7 +23,7 @@ func (c *Chain) GetRouteFor(addr string) (r *Route) {
|
||||
if node == nil {
|
||||
return
|
||||
}
|
||||
if node.bypass != nil && node.bypass.Contains(addr) {
|
||||
if node.bypass != nil && node.bypass.Contains(address) {
|
||||
break
|
||||
}
|
||||
|
||||
@ -33,3 +37,7 @@ func (c *Chain) GetRouteFor(addr string) (r *Route) {
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (c *Chain) IsEmpty() bool {
|
||||
return c == nil || len(c.groups) == 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user