1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00

support more than one type for a config

This commit is contained in:
Shelikhoo 2021-09-07 14:48:44 +01:00
parent 9b93bb614a
commit c89d629943
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -19,7 +19,13 @@ type implementationRegistry struct {
}
func (i *implementationRegistry) RegisterImplementation(name string, opt *protoext.MessageOpt, loader CustomLoader) {
interfaceType := opt.GetType()[0]
interfaceType := opt.GetType()
for _, v := range interfaceType {
i.registerSingleImplementation(v, name, opt, loader)
}
}
func (i *implementationRegistry) registerSingleImplementation(interfaceType, name string, opt *protoext.MessageOpt, loader CustomLoader) {
implSet, found := i.implSet[interfaceType]
if !found {
implSet = newImplementationSet()