1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-20 19:06:09 -04:00
v2fly/transport/internet/authenticators/noop/noop.go

28 lines
659 B
Go
Raw Normal View History

package noop
import (
2016-08-20 14:55:45 -04:00
"v2ray.com/core/common/alloc"
"v2ray.com/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{}
2016-09-21 08:39:07 -04:00
func (this NoOpAuthenticatorFactory) Create(config interface{}) internet.Authenticator {
return NoOpAuthenticator{}
}
func init() {
2016-08-25 07:25:59 -04:00
internet.RegisterAuthenticator("none", NoOpAuthenticatorFactory{})
2016-09-21 08:39:07 -04:00
internet.RegisterAuthenticatorConfig("none", func() interface{} { return &Config{} })
}