Commit e16ac5a5 authored by Hubix9's avatar Hubix9 Committed by ginuerzh

Add whitelist/blacklist support for relay

parent 4712d6c9
......@@ -203,6 +203,13 @@ func (h *relayHandler) Handle(conn net.Conn) {
if udp {
network = "udp"
}
if !Can(network, raddr, h.options.Whitelist, h.options.Blacklist) {
resp.Status = relay.StatusForbidden
resp.WriteTo(conn)
log.Logf("[relay] %s -> %s : relay to %s is forbidden",
conn.RemoteAddr(), conn.LocalAddr(), raddr)
return
}
ctx := context.TODO()
var cc net.Conn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment