Browse Source

add an option to include JSON loader in v2ray binary.

pull/1086/head
Darien Raymond 7 years ago
parent
commit
97341693f3
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 5
      main/distro/all/all.go
  2. 15
      main/jsonem/jsonem.go

5
main/distro/all/all.go

@ -47,8 +47,11 @@ import (
_ "v2ray.com/core/transport/internet/headers/utp"
_ "v2ray.com/core/transport/internet/headers/wechat"
// JSON config format
// JSON config support. Choose only one from the two below.
// The following line loads JSON from v2ctl
_ "v2ray.com/core/main/json"
// The following line loads JSON internally
// _ "v2ray.com/core/main/jsonem"
// Load config from file or http(s)
_ "v2ray.com/core/main/confloader/external"

15
main/jsonem/jsonem.go

@ -0,0 +1,15 @@
package jsonem
import (
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/ext/tools/conf/serial"
)
func init() {
common.Must(core.RegisterConfigLoader(&core.ConfigFormat{
Name: "JSON",
Extension: []string{"json"},
Loader: serial.LoadJSONConfig,
}))
}
Loading…
Cancel
Save