mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
response factory
This commit is contained in:
parent
187688cacb
commit
d3f323e24b
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
"v2ray.com/core/common/alloc"
|
||||
"v2ray.com/core/common/loader"
|
||||
"v2ray.com/core/transport/internet"
|
||||
)
|
||||
|
||||
@ -118,3 +119,16 @@ func (this *ResponseAuthenticator) Open(reader io.Reader) (io.Reader, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type ResponseAuthenticatorFactory struct{}
|
||||
|
||||
func (ResponseAuthenticatorFactory) Create(config interface{}) internet.ConnectionAuthenticator {
|
||||
return &ResponseAuthenticator{
|
||||
config: config.(*ResponseConfig),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
internet.RegisterConnectionAuthenticator(loader.GetType(new(RequestConfig)), RequestAuthenticatorFactory{})
|
||||
internet.RegisterConnectionAuthenticator(loader.GetType(new(ResponseConfig)), ResponseAuthenticatorFactory{})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user