经过身份验证的ServiceStack.Redis.PooledRedisClientsManager

时间:2012-01-14 13:38:27

标签: authentication redis servicestack appharbor

如何在实例化PooledRedisClientManager时为Redis主机名指定用户名和密码?

var _redis = PooledRedisClientManager("my.redishost.com:1234");

我特别需要将基于.NET的ServiceStack.Redis应用程序部署到AppHarbor,我正在使用 Redis To Go 进行Redis托管。

1 个答案:

答案 0 :(得分:22)

https://github.com/ServiceStack/ServiceStack.Redis/wiki/Authentication

要使用密码对Redis进行身份验证,只需使用password @ host语法传入连接字符串:

container.Register(c => new PooledRedisClientManager("password@host:6379"));