forked from External/ergo
fix #1389
Support PROXY protocol v2, including ahead of plaintext connections
This commit is contained in:
parent
9ce72a4b02
commit
3062f97c2b
6 changed files with 153 additions and 41 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue