Explorar o código

more no-op authenticator into a separate folder

v2ray %!s(int64=9) %!d(string=hai) anos
pai
achega
6678da2fe2

+ 1 - 0
shell/point/main/main.go

@@ -26,6 +26,7 @@ import (
 	_ "github.com/v2ray/v2ray-core/transport/internet/tcp"
 	_ "github.com/v2ray/v2ray-core/transport/internet/udp"
 
+	_ "github.com/v2ray/v2ray-core/transport/internet/authenticators/noop"
 	_ "github.com/v2ray/v2ray-core/transport/internet/authenticators/srtp"
 )
 

+ 0 - 22
transport/internet/authenticator.go

@@ -85,25 +85,3 @@ func (this *AuthenticatorChain) Seal(payload *alloc.Buffer) {
 		auth.Seal(payload)
 	}
 }
-
-type NoOpAuthenticator struct{}
-
-func (this NoOpAuthenticator) Overhead() int {
-	return 0
-}
-func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
-	return true
-}
-func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
-
-type NoOpAuthenticatorFactory struct{}
-
-func (this NoOpAuthenticatorFactory) Create(config AuthenticatorConfig) Authenticator {
-	return NoOpAuthenticator{}
-}
-
-type NoOpAuthenticatorConfig struct{}
-
-func init() {
-	RegisterAuthenticator("none", NoOpAuthenticatorFactory{}, func() interface{} { return NoOpAuthenticatorConfig{} })
-}

+ 28 - 0
transport/internet/authenticators/noop/noop.go

@@ -0,0 +1,28 @@
+package noop
+
+import (
+	"github.com/v2ray/v2ray-core/common/alloc"
+	"github.com/v2ray/v2ray-core/transport/internet"
+)
+
+type NoOpAuthenticator struct{}
+
+func (this NoOpAuthenticator) Overhead() int {
+	return 0
+}
+func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
+	return true
+}
+func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
+
+type NoOpAuthenticatorFactory struct{}
+
+func (this NoOpAuthenticatorFactory) Create(config internet.AuthenticatorConfig) internet.Authenticator {
+	return NoOpAuthenticator{}
+}
+
+type NoOpAuthenticatorConfig struct{}
+
+func init() {
+	internet.RegisterAuthenticator("none", NoOpAuthenticatorFactory{}, func() interface{} { return NoOpAuthenticatorConfig{} })
+}