You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
feat: add support for rediss protocol in url
This commit is contained in:
committed by
Ruben Bridgewater
parent
2a586e35b6
commit
5d6e471d0c
@@ -32,7 +32,11 @@ module.exports = function createClient (port_arg, host_arg, options) {
|
||||
options.password = parsed.auth.split(':')[1];
|
||||
}
|
||||
if (parsed.protocol && parsed.protocol !== 'redis:') {
|
||||
console.warn('node_redis: WARNING: You passed "' + parsed.protocol.substring(0, parsed.protocol.length - 1) + '" as protocol instead of the "redis" protocol!');
|
||||
if (parsed.protocol === 'rediss:') {
|
||||
options.tls = options.tls || {};
|
||||
} else {
|
||||
console.warn('node_redis: WARNING: You passed "' + parsed.protocol.substring(0, parsed.protocol.length - 1) + '" as protocol instead of the "redis" protocol!');
|
||||
}
|
||||
}
|
||||
if (parsed.pathname && parsed.pathname !== '/') {
|
||||
options.db = parsed.pathname.substr(1);
|
||||
|
Reference in New Issue
Block a user