diff --git a/knockr.go b/knockr.go index 6dc1ad1..3c2c369 100644 --- a/knockr.go +++ b/knockr.go @@ -48,7 +48,7 @@ func gateway_handler(c net.Conn) { if is_whitelisted(host) { fmt.Println("OK: ", host) - io.WriteString(c, "Hola o/") + proxy(c) } else { fmt.Println("BLOCK: ", host) } @@ -70,3 +70,13 @@ func is_whitelisted(addr string) bool { return false } + +func proxy(c net.Conn) { + ln, err := net.Dial("tcp", "ip.darknebu.la:443") + if err != nil { + fmt.Println("ERR proxy") + } else { + go io.Copy(c, ln) + io.Copy(ln, c) + } +}