diff --git a/infra/vformat/main.go b/infra/vformat/main.go index ea57e5b0563..e804a5aecd4 100644 --- a/infra/vformat/main.go +++ b/infra/vformat/main.go @@ -180,7 +180,7 @@ func main() { if strings.HasSuffix(filename, ".go") && !strings.HasSuffix(filename, ".pb.go") && !strings.Contains(dir, filepath.Join("testing", "mocks")) && - !strings.Contains(path, filepath.Join("main", "distro", "all", "all.go")) { + !strings.Contains(path, filepath.Join("main", "distro", "all", "all.go", "minimal.go")) { if changedFiles != nil && !changedFiles[path] { return nil diff --git a/main/distro/mimimal/minimal.go b/main/distro/mimimal/minimal.go new file mode 100644 index 00000000000..750765b00ce --- /dev/null +++ b/main/distro/mimimal/minimal.go @@ -0,0 +1,73 @@ +package mimimal + +import ( + // The following are necessary as they register handlers in their init functions. + + // Mandatory features. Can't remove unless there are replacements. + _ "github.com/v2fly/v2ray-core/v5/app/dispatcher" + _ "github.com/v2fly/v2ray-core/v5/app/proxyman/inbound" + _ "github.com/v2fly/v2ray-core/v5/app/proxyman/outbound" + + // Other optional features. + _ "github.com/v2fly/v2ray-core/v5/app/dns" + _ "github.com/v2fly/v2ray-core/v5/app/log" + _ "github.com/v2fly/v2ray-core/v5/app/policy" + _ "github.com/v2fly/v2ray-core/v5/app/reverse" + _ "github.com/v2fly/v2ray-core/v5/app/router" + _ "github.com/v2fly/v2ray-core/v5/app/stats" + + // Fix dependency cycle caused by core import in internet package + _ "github.com/v2fly/v2ray-core/v5/transport/internet/tagged/taggedimpl" + + // Developer preview features + _ "github.com/v2fly/v2ray-core/v5/app/observatory" + + // Inbound and outbound proxies. + _ "github.com/v2fly/v2ray-core/v5/proxy/blackhole" + _ "github.com/v2fly/v2ray-core/v5/proxy/dns" + _ "github.com/v2fly/v2ray-core/v5/proxy/dokodemo" + _ "github.com/v2fly/v2ray-core/v5/proxy/freedom" + _ "github.com/v2fly/v2ray-core/v5/proxy/http" + _ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks" + _ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/plugin/external" + _ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/plugin/self" + _ "github.com/v2fly/v2ray-core/v5/proxy/socks" + _ "github.com/v2fly/v2ray-core/v5/proxy/trojan" + _ "github.com/v2fly/v2ray-core/v5/proxy/vless/inbound" + _ "github.com/v2fly/v2ray-core/v5/proxy/vless/outbound" + _ "github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound" + _ "github.com/v2fly/v2ray-core/v5/proxy/vmess/outbound" + + // Transports + _ "github.com/v2fly/v2ray-core/v5/transport/internet/domainsocket" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/grpc" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/http" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/kcp" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/quic" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/tcp" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/tls" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/udp" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/websocket" + + // Transport headers + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/http" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/noop" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/srtp" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/tls" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/utp" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/wechat" + _ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/wireguard" + + // Geo loaders + _ "github.com/v2fly/v2ray-core/v5/infra/conf/geodata/memconservative" + _ "github.com/v2fly/v2ray-core/v5/infra/conf/geodata/standard" + + // JSON, TOML, YAML config support. (jsonv4) This disable selective compile + _ "github.com/v2fly/v2ray-core/v5/main/formats" + + // Simplified config + _ "github.com/v2fly/v2ray-core/v5/proxy/http/simplified" + _ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/simplified" + _ "github.com/v2fly/v2ray-core/v5/proxy/socks/simplified" + _ "github.com/v2fly/v2ray-core/v5/proxy/trojan/simplified" +)