inbound.go 538 B

123456789101112131415161718192021222324
  1. package json
  2. import (
  3. "github.com/v2ray/v2ray-core/proxy/common/config/json"
  4. vmessconfig "github.com/v2ray/v2ray-core/proxy/vmess/config"
  5. )
  6. type Inbound struct {
  7. AllowedClients []*ConfigUser `json:"clients"`
  8. }
  9. func (c *Inbound) AllowedUsers() []vmessconfig.User {
  10. users := make([]vmessconfig.User, 0, len(c.AllowedClients))
  11. for _, rawUser := range c.AllowedClients {
  12. users = append(users, rawUser)
  13. }
  14. return users
  15. }
  16. func init() {
  17. json.RegisterInboundConnectionConfig("vmess", func() interface{} {
  18. return new(Inbound)
  19. })
  20. }