noop.go 659 B

123456789101112131415161718192021222324252627
  1. package noop
  2. import (
  3. "v2ray.com/core/common/alloc"
  4. "v2ray.com/core/transport/internet"
  5. )
  6. type NoOpAuthenticator struct{}
  7. func (this NoOpAuthenticator) Overhead() int {
  8. return 0
  9. }
  10. func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
  11. return true
  12. }
  13. func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
  14. type NoOpAuthenticatorFactory struct{}
  15. func (this NoOpAuthenticatorFactory) Create(config interface{}) internet.Authenticator {
  16. return NoOpAuthenticator{}
  17. }
  18. func init() {
  19. internet.RegisterAuthenticator("none", NoOpAuthenticatorFactory{})
  20. internet.RegisterAuthenticatorConfig("none", func() interface{} { return &Config{} })
  21. }