Skip to content

Commit c4b22cf

Browse files
authored
Version 1.2.1
Added work mode(blacklist/whitelist) for ipchecker. Now a few countries can be given for ip check
1 parent cc4043a commit c4b22cf

File tree

5 files changed

+14
-22
lines changed

5 files changed

+14
-22
lines changed

shadowsocks.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ func createSsServerConfig(str string) (errstr string) {
8181
} else {
8282
conf.Address = spstr[:index]
8383
//check ip
84-
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey, config.IpCheckValue) {
84+
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey,
85+
config.IpCheckValue, config.IpCheckBlackList) {
8586
return "Ip is invalid"
8687
}
8788
//

trojan.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func createTrojanServerConfig(ser_passw string, params string) (errstr string) {
5454
portInd := strings.IndexByte(ser, ':')
5555
conf.Address = ser[:portInd]
5656
//check ip
57-
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey, config.IpCheckValue) {
57+
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey,
58+
config.IpCheckValue, config.IpCheckBlackList) {
5859
return "Ip is invalid"
5960
}
6061
//

vless.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ func createVlessServerConfig(uid_ser string, params string) (errstr string) {
6161
portInd := strings.IndexByte(ser, ':')
6262
conf.Address = ser[:portInd]
6363
//check ip
64-
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey, config.IpCheckValue) {
64+
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey,
65+
config.IpCheckValue, config.IpCheckBlackList) {
6566
return "Ip is invalid"
6667
}
6768
//

vmess.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ func createVmessServerConfig(str string) (errstr string) {
5050
conf := new(VmessServerConfig)
5151
conf.Address = params["add"].(string)
5252
//check ip
53-
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey, config.IpCheckValue) {
53+
if !isIpValid(config.IpCheckServer, conf.Address, config.IpCheckKey,
54+
config.IpCheckValue, config.IpCheckBlackList) {
5455
return "Ip is invalid"
5556
}
5657
//

xrkeyparser.go

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,12 @@ type Config struct {
4545
ConfigSectionPath []string
4646
ServersEditPos int
4747
Tag string
48-
//SsConfigSectionPath []string
49-
//SsServersEditPos int
50-
//SsModeDefault string
51-
//SsTimeOutDefault int32
52-
//SsTag string
53-
//SsMultipleOutbounds bool
54-
//VlessConfigSectionPath []string
55-
//VlessServersEditPos int
56-
//VlessMultipleOutbounds bool
57-
//VlessTag string
58-
//VmessConfigSectionPath []string
59-
//VmessServersEditPos int
60-
//VmessTag string
61-
OutputFile string
62-
Links []Link
63-
IpCheckServer string
64-
IpCheckKey string
65-
IpCheckValue string
48+
OutputFile string
49+
Links []Link
50+
IpCheckServer string
51+
IpCheckKey string
52+
IpCheckBlackList bool
53+
IpCheckValue []string
6654
}
6755

6856
type ParseResult struct {

0 commit comments

Comments
 (0)