mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
more no-op authenticator into a separate folder
This commit is contained in:
parent
8d6a9167b5
commit
6678da2fe2
@ -26,6 +26,7 @@ import (
|
|||||||
_ "github.com/v2ray/v2ray-core/transport/internet/tcp"
|
_ "github.com/v2ray/v2ray-core/transport/internet/tcp"
|
||||||
_ "github.com/v2ray/v2ray-core/transport/internet/udp"
|
_ "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"
|
_ "github.com/v2ray/v2ray-core/transport/internet/authenticators/srtp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -85,25 +85,3 @@ func (this *AuthenticatorChain) Seal(payload *alloc.Buffer) {
|
|||||||
auth.Seal(payload)
|
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
transport/internet/authenticators/noop/noop.go
Normal file
28
transport/internet/authenticators/noop/noop.go
Normal file
@ -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{} })
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user