From 092217182af13113538999c304f1d13b55de6b28 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 6 Dec 2015 18:21:15 +0100 Subject: [PATCH] simplify config directory --- proxy/blackhole/config.go | 4 + proxy/blackhole/{config => }/json/json.go | 0 proxy/dokodemo/config.go | 11 + proxy/dokodemo/config/json/json.go | 20 -- proxy/dokodemo/dokodemo.go | 25 +-- proxy/dokodemo/dokodemo_factory.go | 3 +- proxy/dokodemo/dokodemo_test.go | 18 +- proxy/dokodemo/json/json.go | 39 ++++ proxy/freedom/config.go | 4 + proxy/freedom/freedom_test.go | 2 +- proxy/freedom/{config => }/json/json.go | 0 proxy/socks/{config => }/config.go | 4 +- proxy/socks/{config => }/json/config.go | 0 proxy/socks/{config => }/json/config_test.go | 0 proxy/socks/socks.go | 5 +- proxy/socks/socks_test.go | 2 +- proxy/socks/socksfactory.go | 3 +- release/server/main.go | 8 +- shell/point/json/json_test.go | 6 +- testing/scenarios/access.log | 204 +++++++++++++++++++ testing/scenarios/server_env.go | 8 +- 21 files changed, 299 insertions(+), 67 deletions(-) create mode 100644 proxy/blackhole/config.go rename proxy/blackhole/{config => }/json/json.go (100%) create mode 100644 proxy/dokodemo/config.go delete mode 100644 proxy/dokodemo/config/json/json.go create mode 100644 proxy/dokodemo/json/json.go create mode 100644 proxy/freedom/config.go rename proxy/freedom/{config => }/json/json.go (100%) rename proxy/socks/{config => }/config.go (75%) rename proxy/socks/{config => }/json/config.go (100%) rename proxy/socks/{config => }/json/config_test.go (100%) diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go new file mode 100644 index 000000000..a4f116005 --- /dev/null +++ b/proxy/blackhole/config.go @@ -0,0 +1,4 @@ +package blackhole + +type Config interface { +} diff --git a/proxy/blackhole/config/json/json.go b/proxy/blackhole/json/json.go similarity index 100% rename from proxy/blackhole/config/json/json.go rename to proxy/blackhole/json/json.go diff --git a/proxy/dokodemo/config.go b/proxy/dokodemo/config.go new file mode 100644 index 000000000..fb55ae50f --- /dev/null +++ b/proxy/dokodemo/config.go @@ -0,0 +1,11 @@ +package dokodemo + +import ( + v2net "github.com/v2ray/v2ray-core/common/net" +) + +type Config interface { + Address() v2net.Address + Network() v2net.NetworkList + Timeout() int +} diff --git a/proxy/dokodemo/config/json/json.go b/proxy/dokodemo/config/json/json.go deleted file mode 100644 index 04416b9ad..000000000 --- a/proxy/dokodemo/config/json/json.go +++ /dev/null @@ -1,20 +0,0 @@ -package json - -import ( - v2net "github.com/v2ray/v2ray-core/common/net" - v2netjson "github.com/v2ray/v2ray-core/common/net/json" - "github.com/v2ray/v2ray-core/proxy/common/config/json" -) - -type DokodemoConfig struct { - Host string `json:"address"` - Port v2net.Port `json:"port"` - Network *v2netjson.NetworkList `json:"network"` - Timeout int `json:"timeout"` -} - -func init() { - json.RegisterInboundConnectionConfig("dokodemo-door", func() interface{} { - return new(DokodemoConfig) - }) -} diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index b06313b7c..a127ca478 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -10,40 +10,33 @@ import ( "github.com/v2ray/v2ray-core/common/log" v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/retry" - "github.com/v2ray/v2ray-core/proxy/dokodemo/config/json" ) type DokodemoDoor struct { - config *json.DokodemoConfig + config Config accepting bool address v2net.Address space *app.Space } -func NewDokodemoDoor(space *app.Space, config *json.DokodemoConfig) *DokodemoDoor { - d := &DokodemoDoor{ - config: config, - space: space, +func NewDokodemoDoor(space *app.Space, config Config) *DokodemoDoor { + return &DokodemoDoor{ + config: config, + space: space, + address: config.Address(), } - ip := net.ParseIP(config.Host) - if ip != nil { - d.address = v2net.IPAddress(ip, config.Port) - } else { - d.address = v2net.DomainAddress(config.Host, config.Port) - } - return d } func (this *DokodemoDoor) Listen(port v2net.Port) error { this.accepting = true - if this.config.Network.HasNetwork(v2net.TCPNetwork) { + if this.config.Network().HasNetwork(v2net.TCPNetwork) { err := this.ListenTCP(port) if err != nil { return err } } - if this.config.Network.HasNetwork(v2net.UDPNetwork) { + if this.config.Network().HasNetwork(v2net.UDPNetwork) { err := this.ListenUDP(port) if err != nil { return err @@ -126,7 +119,7 @@ func (this *DokodemoDoor) HandleTCPConnection(conn *net.TCPConn) { inputFinish.Lock() outputFinish.Lock() - reader := v2net.NewTimeOutReader(this.config.Timeout, conn) + reader := v2net.NewTimeOutReader(this.config.Timeout(), conn) go dumpInput(reader, ray.InboundInput(), &inputFinish) go dumpOutput(conn, ray.InboundOutput(), &outputFinish) diff --git a/proxy/dokodemo/dokodemo_factory.go b/proxy/dokodemo/dokodemo_factory.go index 561d272e9..b6efe6fb8 100644 --- a/proxy/dokodemo/dokodemo_factory.go +++ b/proxy/dokodemo/dokodemo_factory.go @@ -3,14 +3,13 @@ package dokodemo import ( "github.com/v2ray/v2ray-core/app" "github.com/v2ray/v2ray-core/proxy/common/connhandler" - "github.com/v2ray/v2ray-core/proxy/dokodemo/config/json" ) type DokodemoDoorFactory struct { } func (this DokodemoDoorFactory) Create(space *app.Space, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) { - config := rawConfig.(*json.DokodemoConfig) + config := rawConfig.(Config) return NewDokodemoDoor(space, config), nil } diff --git a/proxy/dokodemo/dokodemo_test.go b/proxy/dokodemo/dokodemo_test.go index c227e2fa5..e7dec464d 100644 --- a/proxy/dokodemo/dokodemo_test.go +++ b/proxy/dokodemo/dokodemo_test.go @@ -6,7 +6,7 @@ import ( v2netjson "github.com/v2ray/v2ray-core/common/net/json" v2nettesting "github.com/v2ray/v2ray-core/common/net/testing" - "github.com/v2ray/v2ray-core/proxy/dokodemo/config/json" + "github.com/v2ray/v2ray-core/proxy/dokodemo/json" _ "github.com/v2ray/v2ray-core/proxy/freedom" "github.com/v2ray/v2ray-core/shell/point" "github.com/v2ray/v2ray-core/shell/point/testing/mocks" @@ -42,10 +42,10 @@ func TestDokodemoTCP(t *testing.T) { InboundConfigValue: &mocks.ConnectionConfig{ ProtocolValue: "dokodemo-door", SettingsValue: &json.DokodemoConfig{ - Host: "127.0.0.1", - Port: port, - Network: &networkList, - Timeout: 0, + Host: "127.0.0.1", + Port: port, + NetworkList: &networkList, + TimeoutValue: 0, }, }, OutboundConfigValue: &mocks.ConnectionConfig{ @@ -104,10 +104,10 @@ func TestDokodemoUDP(t *testing.T) { InboundConfigValue: &mocks.ConnectionConfig{ ProtocolValue: "dokodemo-door", SettingsValue: &json.DokodemoConfig{ - Host: "127.0.0.1", - Port: port, - Network: &networkList, - Timeout: 0, + Host: "127.0.0.1", + Port: port, + NetworkList: &networkList, + TimeoutValue: 0, }, }, OutboundConfigValue: &mocks.ConnectionConfig{ diff --git a/proxy/dokodemo/json/json.go b/proxy/dokodemo/json/json.go new file mode 100644 index 000000000..72a503c73 --- /dev/null +++ b/proxy/dokodemo/json/json.go @@ -0,0 +1,39 @@ +package json + +import ( + "net" + + v2net "github.com/v2ray/v2ray-core/common/net" + v2netjson "github.com/v2ray/v2ray-core/common/net/json" + "github.com/v2ray/v2ray-core/proxy/common/config/json" +) + +type DokodemoConfig struct { + Host string `json:"address"` + Port v2net.Port `json:"port"` + NetworkList *v2netjson.NetworkList `json:"network"` + TimeoutValue int `json:"timeout"` +} + +func (this *DokodemoConfig) Address() v2net.Address { + ip := net.ParseIP(this.Host) + if ip != nil { + return v2net.IPAddress(ip, this.Port) + } else { + return v2net.DomainAddress(this.Host, this.Port) + } +} + +func (this *DokodemoConfig) Network() v2net.NetworkList { + return this.NetworkList +} + +func (this *DokodemoConfig) Timeout() int { + return this.TimeoutValue +} + +func init() { + json.RegisterInboundConnectionConfig("dokodemo-door", func() interface{} { + return new(DokodemoConfig) + }) +} diff --git a/proxy/freedom/config.go b/proxy/freedom/config.go new file mode 100644 index 000000000..82d859bad --- /dev/null +++ b/proxy/freedom/config.go @@ -0,0 +1,4 @@ +package freedom + +type Config interface { +} diff --git a/proxy/freedom/freedom_test.go b/proxy/freedom/freedom_test.go index 9292c42e8..30ea273c1 100644 --- a/proxy/freedom/freedom_test.go +++ b/proxy/freedom/freedom_test.go @@ -14,7 +14,7 @@ import ( v2nettesting "github.com/v2ray/v2ray-core/common/net/testing" "github.com/v2ray/v2ray-core/proxy/common/connhandler" _ "github.com/v2ray/v2ray-core/proxy/socks" - "github.com/v2ray/v2ray-core/proxy/socks/config/json" + "github.com/v2ray/v2ray-core/proxy/socks/json" proxymocks "github.com/v2ray/v2ray-core/proxy/testing/mocks" "github.com/v2ray/v2ray-core/shell/point" "github.com/v2ray/v2ray-core/shell/point/testing/mocks" diff --git a/proxy/freedom/config/json/json.go b/proxy/freedom/json/json.go similarity index 100% rename from proxy/freedom/config/json/json.go rename to proxy/freedom/json/json.go diff --git a/proxy/socks/config/config.go b/proxy/socks/config.go similarity index 75% rename from proxy/socks/config/config.go rename to proxy/socks/config.go index b375f03a3..ef87d6c7b 100644 --- a/proxy/socks/config/config.go +++ b/proxy/socks/config.go @@ -1,10 +1,10 @@ -package config +package socks import ( "net" ) -type SocksConfig interface { +type Config interface { IsNoAuth() bool IsPassword() bool HasAccount(username, password string) bool diff --git a/proxy/socks/config/json/config.go b/proxy/socks/json/config.go similarity index 100% rename from proxy/socks/config/json/config.go rename to proxy/socks/json/config.go diff --git a/proxy/socks/config/json/config_test.go b/proxy/socks/json/config_test.go similarity index 100% rename from proxy/socks/config/json/config_test.go rename to proxy/socks/json/config_test.go diff --git a/proxy/socks/socks.go b/proxy/socks/socks.go index 1b52fcd2b..f2de09a54 100644 --- a/proxy/socks/socks.go +++ b/proxy/socks/socks.go @@ -13,7 +13,6 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/retry" proxyerrors "github.com/v2ray/v2ray-core/proxy/common/errors" - "github.com/v2ray/v2ray-core/proxy/socks/config" "github.com/v2ray/v2ray-core/proxy/socks/protocol" ) @@ -26,10 +25,10 @@ var ( type SocksServer struct { accepting bool space *app.Space - config config.SocksConfig + config Config } -func NewSocksServer(space *app.Space, config config.SocksConfig) *SocksServer { +func NewSocksServer(space *app.Space, config Config) *SocksServer { return &SocksServer{ space: space, config: config, diff --git a/proxy/socks/socks_test.go b/proxy/socks/socks_test.go index 67cec6804..1c6be4635 100644 --- a/proxy/socks/socks_test.go +++ b/proxy/socks/socks_test.go @@ -11,7 +11,7 @@ import ( v2nettesting "github.com/v2ray/v2ray-core/common/net/testing" "github.com/v2ray/v2ray-core/proxy/common/connhandler" - "github.com/v2ray/v2ray-core/proxy/socks/config/json" + "github.com/v2ray/v2ray-core/proxy/socks/json" proxymocks "github.com/v2ray/v2ray-core/proxy/testing/mocks" "github.com/v2ray/v2ray-core/shell/point" "github.com/v2ray/v2ray-core/shell/point/testing/mocks" diff --git a/proxy/socks/socksfactory.go b/proxy/socks/socksfactory.go index c3e047b9b..3e60ccc02 100644 --- a/proxy/socks/socksfactory.go +++ b/proxy/socks/socksfactory.go @@ -3,14 +3,13 @@ package socks import ( "github.com/v2ray/v2ray-core/app" "github.com/v2ray/v2ray-core/proxy/common/connhandler" - "github.com/v2ray/v2ray-core/proxy/socks/config" ) type SocksServerFactory struct { } func (this SocksServerFactory) Create(space *app.Space, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) { - return NewSocksServer(space, rawConfig.(config.SocksConfig)), nil + return NewSocksServer(space, rawConfig.(Config)), nil } func init() { diff --git a/release/server/main.go b/release/server/main.go index e403e366c..59cc2d80d 100644 --- a/release/server/main.go +++ b/release/server/main.go @@ -16,13 +16,13 @@ import ( // The following are neccesary as they register handlers in their init functions. _ "github.com/v2ray/v2ray-core/proxy/blackhole" - _ "github.com/v2ray/v2ray-core/proxy/blackhole/config/json" + _ "github.com/v2ray/v2ray-core/proxy/blackhole/json" _ "github.com/v2ray/v2ray-core/proxy/dokodemo" - _ "github.com/v2ray/v2ray-core/proxy/dokodemo/config/json" + _ "github.com/v2ray/v2ray-core/proxy/dokodemo/json" _ "github.com/v2ray/v2ray-core/proxy/freedom" - _ "github.com/v2ray/v2ray-core/proxy/freedom/config/json" + _ "github.com/v2ray/v2ray-core/proxy/freedom/json" _ "github.com/v2ray/v2ray-core/proxy/socks" - _ "github.com/v2ray/v2ray-core/proxy/socks/config/json" + _ "github.com/v2ray/v2ray-core/proxy/socks/json" _ "github.com/v2ray/v2ray-core/proxy/vmess" _ "github.com/v2ray/v2ray-core/proxy/vmess/config/json" ) diff --git a/shell/point/json/json_test.go b/shell/point/json/json_test.go index 3d04d9d35..3bf2745eb 100644 --- a/shell/point/json/json_test.go +++ b/shell/point/json/json_test.go @@ -4,9 +4,9 @@ import ( "path/filepath" "testing" - _ "github.com/v2ray/v2ray-core/proxy/dokodemo/config/json" - _ "github.com/v2ray/v2ray-core/proxy/freedom/config/json" - _ "github.com/v2ray/v2ray-core/proxy/socks/config/json" + _ "github.com/v2ray/v2ray-core/proxy/dokodemo/json" + _ "github.com/v2ray/v2ray-core/proxy/freedom/json" + _ "github.com/v2ray/v2ray-core/proxy/socks/json" _ "github.com/v2ray/v2ray-core/proxy/vmess/config/json" "github.com/v2ray/v2ray-core/shell/point/json" diff --git a/testing/scenarios/access.log b/testing/scenarios/access.log index 94d71d38b..73b1ac0d9 100644 --- a/testing/scenarios/access.log +++ b/testing/scenarios/access.log @@ -406,3 +406,207 @@ 2015/12/06 16:39:38 127.0.0.1:64810 accepted 127.0.0.1:30001 2015/12/06 16:39:38 127.0.0.1:64813 accepted 127.0.0.1:30001 2015/12/06 16:39:38 127.0.0.1:64817 accepted 127.0.0.1:30003 +2015/12/06 18:14:59 127.0.0.1:49876 accepted 127.0.0.1:50024 +2015/12/06 18:14:59 127.0.0.1:49880 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49883 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49886 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49889 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49892 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49895 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49898 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49901 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49904 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49907 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49910 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49913 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49916 accepted 127.0.0.1:30001 +2015/12/06 18:14:59 127.0.0.1:49919 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49922 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49925 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49928 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49933 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49936 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49939 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49942 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49945 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49948 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49951 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49954 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49957 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49960 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49963 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49966 accepted 127.0.0.1:30001 +2015/12/06 18:15:00 127.0.0.1:49969 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49972 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49975 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49978 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49981 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49984 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49987 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49990 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49993 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49996 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:49999 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50004 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50023 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50028 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50031 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50034 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50037 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50040 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50043 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50046 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50049 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50052 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50055 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50058 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50061 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50064 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50067 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50070 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50073 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50076 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50079 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50082 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50085 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50088 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50091 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50094 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50097 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50100 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50103 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50106 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50109 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50112 accepted 127.0.0.1:30001 +2015/12/06 18:15:01 127.0.0.1:50115 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50118 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50121 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50124 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50127 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50130 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50133 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50136 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50139 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50142 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50145 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50148 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50151 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50154 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50157 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50160 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50163 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50166 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50169 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50172 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50175 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50178 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50181 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50184 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50187 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50190 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50193 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50196 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50199 accepted 127.0.0.1:30001 +2015/12/06 18:15:02 127.0.0.1:50203 accepted 127.0.0.1:30003 +2015/12/06 18:15:43 127.0.0.1:50303 accepted 127.0.0.1:50024 +2015/12/06 18:15:43 127.0.0.1:50307 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50310 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50313 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50316 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50319 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50324 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50327 accepted 127.0.0.1:30001 +2015/12/06 18:15:44 127.0.0.1:50330 accepted 127.0.0.1:30001 +2015/12/06 18:15:45 127.0.0.1:50333 accepted 127.0.0.1:30001 +2015/12/06 18:15:45 127.0.0.1:50336 accepted 127.0.0.1:30001 +2015/12/06 18:15:45 127.0.0.1:50339 accepted 127.0.0.1:30001 +2015/12/06 18:15:45 127.0.0.1:50342 accepted 127.0.0.1:30001 +2015/12/06 18:15:45 127.0.0.1:50345 accepted 127.0.0.1:30001 +2015/12/06 18:15:45 127.0.0.1:50348 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50351 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50354 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50357 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50360 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50363 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50366 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50369 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50372 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50375 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50378 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50381 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50384 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50387 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50390 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50393 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50396 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50399 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50402 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50405 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50408 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50411 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50414 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50417 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50420 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50423 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50426 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50429 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50432 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50435 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50438 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50441 accepted 127.0.0.1:30001 +2015/12/06 18:15:46 127.0.0.1:50444 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50447 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50450 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50453 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50456 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50459 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50462 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50465 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50468 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50471 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50474 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50477 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50480 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50483 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50486 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50489 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50492 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50495 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50498 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50501 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50504 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50507 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50510 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50513 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50516 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50519 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50522 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50525 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50528 accepted 127.0.0.1:30001 +2015/12/06 18:15:47 127.0.0.1:50531 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50534 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50537 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50540 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50543 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50546 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50549 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50552 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50555 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50558 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50561 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50564 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50567 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50570 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50573 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50576 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50579 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50582 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50585 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50588 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50591 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50594 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50597 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50600 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50603 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50606 accepted 127.0.0.1:30001 +2015/12/06 18:15:48 127.0.0.1:50610 accepted 127.0.0.1:30003 diff --git a/testing/scenarios/server_env.go b/testing/scenarios/server_env.go index 898eb7667..fe699006e 100644 --- a/testing/scenarios/server_env.go +++ b/testing/scenarios/server_env.go @@ -13,13 +13,13 @@ import ( // The following are neccesary as they register handlers in their init functions. _ "github.com/v2ray/v2ray-core/proxy/blackhole" - _ "github.com/v2ray/v2ray-core/proxy/blackhole/config/json" + _ "github.com/v2ray/v2ray-core/proxy/blackhole/json" _ "github.com/v2ray/v2ray-core/proxy/dokodemo" - _ "github.com/v2ray/v2ray-core/proxy/dokodemo/config/json" + _ "github.com/v2ray/v2ray-core/proxy/dokodemo/json" _ "github.com/v2ray/v2ray-core/proxy/freedom" - _ "github.com/v2ray/v2ray-core/proxy/freedom/config/json" + _ "github.com/v2ray/v2ray-core/proxy/freedom/json" _ "github.com/v2ray/v2ray-core/proxy/socks" - _ "github.com/v2ray/v2ray-core/proxy/socks/config/json" + _ "github.com/v2ray/v2ray-core/proxy/socks/json" _ "github.com/v2ray/v2ray-core/proxy/vmess" _ "github.com/v2ray/v2ray-core/proxy/vmess/config/json" )