Skip to content

Commit

Permalink
fix jsonsub required rules #451
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Feb 15, 2025
1 parent 66c3f14 commit 1535338
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func InitDB(dbPath string) error {
db.Migrator().CreateTable(&model.Outbound{})
defaultOutbound := []model.Outbound{
{Type: "direct", Tag: "direct", Options: json.RawMessage(`{}`)},
{Type: "dns", Tag: "dns-out", Options: json.RawMessage(`{}`)},
}
db.Create(&defaultOutbound)
}
Expand Down
5 changes: 5 additions & 0 deletions sub/jsonService.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,17 @@ func (j *JsonService) addDefaultOutbounds(outbounds *[]map[string]interface{}, o

func (j *JsonService) addOthers(jsonConfig *map[string]interface{}) error {
rules := []interface{}{
map[string]interface{}{
"action": "sniff",
},
map[string]interface{}{
"clash_mode": "Direct",
"action": "route",
"outbound": "direct",
},
map[string]interface{}{
"clash_mode": "Global",
"action": "route",
"outbound": "proxy",
},
}
Expand Down

0 comments on commit 1535338

Please sign in to comment.