mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-02 05:46:39 +00:00
Like sing-box's strict_route, strictRoute is now false by default, so the Windows Filtering Platform filters are only added when it is set to true (together with autoSystemRoutingTable). With unset meaning false, strict_route becomes a plain bool field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
582 B
Go
28 lines
582 B
Go
package conf_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "github.com/xtls/xray-core/infra/conf"
|
|
"github.com/xtls/xray-core/proxy/tun"
|
|
)
|
|
|
|
func TestTunConfigStrictRoute(t *testing.T) {
|
|
creator := func() Buildable {
|
|
return new(TunConfig)
|
|
}
|
|
|
|
runMultiTestCase(t, []TestCase{
|
|
{
|
|
Input: `{"name": "xray0"}`,
|
|
Parser: loadJSON(creator),
|
|
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500},
|
|
},
|
|
{
|
|
Input: `{"name": "xray0", "strictRoute": true}`,
|
|
Parser: loadJSON(creator),
|
|
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, StrictRoute: true},
|
|
},
|
|
})
|
|
}
|