change blockedips to AllowedIps

now only those IPs that are allowed are able to establish a connection; other connections are dropped it will happen every 10 sec
after user offline that IPs will be removed from AllowedIps
This commit is contained in:
MHSanaei
2023-05-25 03:21:31 +03:30
parent 896cc5386c
commit 6f28a3a2fe
2 changed files with 60 additions and 41 deletions

View File

@@ -51,8 +51,8 @@ func GetIranPath() string {
return config.GetBinFolderPath() + "/iran.dat"
}
func GetBlockedIPsPath() string {
return config.GetBinFolderPath() + "/blockedIPs"
func GetAllowedIPsPath() string {
return config.GetBinFolderPath() + "/AllowedIPs"
}
func stopProcess(p *Process) {
@@ -173,7 +173,7 @@ func (p *process) Start() (err error) {
return common.NewErrorf("Failed to write configuration file: %v", err)
}
cmd := exec.Command(GetBinaryPath(), "-c", configPath, "-restrictedIPsPath", GetBlockedIPsPath())
cmd := exec.Command(GetBinaryPath(), "-c", configPath, "-restrictedIPsPath", GetAllowedIPsPath())
p.cmd = cmd
stdReader, err := cmd.StdoutPipe()