Skip to content

Commit

Permalink
Add minimal import package
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jan 10, 2022
1 parent 0c7ae3c commit d432433
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infra/vformat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
73 changes: 73 additions & 0 deletions main/distro/mimimal/minimal.go
Original file line number Diff line number Diff line change
@@ -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"
)

0 comments on commit d432433

Please # to comment.