func init() { internal.MustRegisterInboundHandlerCreator("vmess", func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) { if !space.HasApp(dispatcher.APP_ID) { return nil, internal.ErrorBadConfiguration } config := rawConfig.(*Config) allowedClients := protocol.NewTimedUserSet() for _, user := range config.AllowedUsers { allowedClients.AddUser(user) } handler := &VMessInboundHandler{ packetDispatcher: space.GetApp(dispatcher.APP_ID).(dispatcher.PacketDispatcher), clients: allowedClients, features: config.Features, user: config.AllowedUsers[0], } if space.HasApp(proxyman.APP_ID_INBOUND_MANAGER) { handler.inboundHandlerManager = space.GetApp(proxyman.APP_ID_INBOUND_MANAGER).(proxyman.InboundHandlerManager) } return handler, nil }) }
func init() { internal.MustRegisterInboundConnectionHandlerCreator("vmess", func(space app.Space, rawConfig interface{}) (proxy.InboundConnectionHandler, error) { config := rawConfig.(*Config) allowedClients := protocol.NewTimedUserSet() for _, user := range config.AllowedUsers { allowedClients.AddUser(user) } return NewVMessInboundHandler(space, allowedClients), nil }) }
func init() { internal.MustRegisterInboundHandlerCreator("vmess", func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) { config := rawConfig.(*Config) allowedClients := protocol.NewTimedUserSet() for _, user := range config.AllowedUsers { allowedClients.AddUser(user) } return &VMessInboundHandler{ space: space, clients: allowedClients, features: config.Features, user: config.AllowedUsers[0], }, nil }) }