Skip to content

Commit

Permalink
feat: support ext in geoip direct codes
Browse files Browse the repository at this point in the history
  • Loading branch information
yichya committed Jun 26, 2024
1 parent 3a3bb72 commit ff491ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/root/usr/share/xray/gen_config.uc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function rules(proxy, bridge, manual_tproxy, extra_inbound, fakedns) {
let direct_rules = [];
if (geoip_existence) {
if (proxy["geoip_direct_code_list"] != null) {
const geoip_direct_code_list = map(proxy["geoip_direct_code_list"] || [], v => "geoip:" + v);
const geoip_direct_code_list = map(proxy["geoip_direct_code_list"] || [], v => index(v, ":") > 0 ? v : `geoip:${v}`);
if (length(geoip_direct_code_list) > 0) {
push(direct_rules, {
type: "field",
Expand All @@ -134,7 +134,7 @@ function rules(proxy, bridge, manual_tproxy, extra_inbound, fakedns) {
ip: geoip_direct_code_list
});
}
const geoip_direct_code_list_v6 = map(proxy["geoip_direct_code_list_v6"] || [], v => "geoip:" + v);
const geoip_direct_code_list_v6 = map(proxy["geoip_direct_code_list_v6"] || [], v => index(v, ":") > 0 ? v : `geoip:${v}`);
if (length(geoip_direct_code_list_v6) > 0) {
push(direct_rules, {
type: "field",
Expand Down

0 comments on commit ff491ce

Please sign in to comment.