1
0
Fork 0
forked from External/ergo
Support PROXY protocol v2, including ahead of plaintext connections
This commit is contained in:
Shivaram Lingamneni 2020-11-19 12:31:58 -05:00
parent 9ce72a4b02
commit 3062f97c2b
6 changed files with 153 additions and 41 deletions

View file

@ -121,9 +121,11 @@ func handleProxyCommand(server *Server, client *Client, session *Session, line s
}
}()
ip, err := utils.ParseProxyLine(line)
ip, err := utils.ParseProxyLineV1(line)
if err != nil {
return err
} else if ip == nil {
return nil
}
if utils.IPInNets(client.realIP, server.Config().Server.proxyAllowedFromNets) {