1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-14 07:58:16 -04:00
v2fly/proxy/vmess/config/json/inbound.go
2015-11-04 21:52:48 +01:00

25 lines
538 B
Go

package json
import (
"github.com/v2ray/v2ray-core/proxy/common/config/json"
vmessconfig "github.com/v2ray/v2ray-core/proxy/vmess/config"
)
type Inbound struct {
AllowedClients []*ConfigUser `json:"clients"`
}
func (c *Inbound) AllowedUsers() []vmessconfig.User {
users := make([]vmessconfig.User, 0, len(c.AllowedClients))
for _, rawUser := range c.AllowedClients {
users = append(users, rawUser)
}
return users
}
func init() {
json.RegisterInboundConnectionConfig("vmess", func() interface{} {
return new(Inbound)
})
}