response factory

pull/314/head
Darien Raymond 2016-11-01 00:42:55 +01:00
parent 187688cacb
commit d3f323e24b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"io" "io"
"v2ray.com/core/common/alloc" "v2ray.com/core/common/alloc"
"v2ray.com/core/common/loader"
"v2ray.com/core/transport/internet" "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{})
}