mirror of
https://github.com/ginuerzh/gost.git
synced 2024-04-21 12:31:34 +00:00
Add whitelist/blacklist support for relay
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user