mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
proxy protocol: add list of allowed IP addresses and IP ranges
"proxy_allowed" setting allows to specify the allowed IP address and IP ranges that can send the proxy header. This setting combined with "proxy_protocol" allows to ignore the header or to reject connections that send the proxy header from a non listed IP
This commit is contained in:
@@ -261,6 +261,13 @@ func TestInitialization(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Error("Inizialize must fail, a SFTP server should be already running")
|
||||
}
|
||||
sftpdConf.BindPort = 4444
|
||||
sftpdConf.ProxyProtocol = 1
|
||||
sftpdConf.ProxyAllowed = []string{"1270.0.0.1"}
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
if err == nil {
|
||||
t.Error("Inizialize must fail, proxy IP allowed is invalid")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBasicSFTPHandling(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user