Using Redis cache/session via UNIX Socket


I’m trying to configure Gogs on a local server, and our Redis uses a UNIX socket for connections, instead of a TCP Port. We would like Gogs to use Redis for the Cache and Session stores.

Is there any way to specify this in the configuration, to get Gogs to connect via the socket?

Something like:

PROVIDER = redis
PROVIDER_CONFIG = network=socket,addr=/opt/var/redis/gogs.sock;db=0

Server is Gogs 0.9.13 on Debian 8.4, with MySQL 5.5.47 and Redis 2.8.17


Hi, based on the documentation of underlying redis driver, I think you give addr a unix socket path works out of box.



For anyone looking for it, this is the right line :
PROVIDER_CONFIG = network=unix,addr=/tmp/redis.sock

Tested on FreeBSD, Gogs

Maybe and could link to some documentation about this ?