Add Surge MITM and scripts

This commit is contained in:
世界
2025-02-02 17:03:27 +08:00
parent b55bfca7de
commit 5e28a80e63
53 changed files with 4437 additions and 15842 deletions

20
script/jsc/time_test.go Normal file
View File

@@ -0,0 +1,20 @@
package jsc_test
import (
"testing"
"time"
"github.com/sagernet/sing-box/script/jsc"
"github.com/dop251/goja"
"github.com/stretchr/testify/require"
)
func TestTimeToValue(t *testing.T) {
t.Parallel()
runtime := goja.New()
now := time.Now()
err := runtime.Set("now", jsc.TimeToValue(runtime, now))
require.NoError(t, err)
println(runtime.Get("now").String())
}