mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
redir: avoid local loop request
This commit is contained in:
1 parent
9bcc18a29b
commit
19acda9ee0
3 files changed
+16
-32
No files matched your search
@@ -98,6 +98,12 @@ func (s *RedirProxy) Serve(c net.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
// loop request
|
||||
if c.LocalAddr().String() == tgt.String() {
|
||||
log.F("[redir] loop request detected")
|
||||
return
|
||||
}
|
||||
|
||||
rc, err := s.dialer.Dial("tcp", tgt.String())
|
||||
if err != nil {
|
||||
log.F("[redir] failed to connect to target: %v", err)
|
||||
|
||||
Reference in new issue
Block a user