hagsteel / swampdragon

swampdragon
Other
556 stars 73 forks source link

Connection Swampdragon to a Redis Socket #209

Open denizs opened 8 years ago

denizs commented 8 years ago

Hey Jonas, big fan of your work! I'm almost done deploying my sd-powered app on my uberspace, however, I'm stuck with the redis config. As Uberspace.de does not allow me to run redis-server on 127.0.0.1:6379, I had to set up a redis socket which runs on /home/{{ User }}/.redis/sock.

Obviously, setting SWAMP_DRAGON_HOST to unix:///home/{{ User }}/.redis/sock and SWAMP_DRAGON_PORT to 0 does not work. After some research, I found that tornadoredis.Client has an argument unix_socket_path which lets you set up the redis connection via unix sockets.

Sadly, I'm still getting an error message after I changed the code respectively:

ERROR:tornado.general:WebSocket
Traceback (most recent call last):
  File ".../site-packages/sockjs/tornado/transports/websocket.py", line 60, in on_message
    self.session.on_messages(msg)
  File ".../site-packages/sockjs/tornado/session.py", line 418, in on_messages
    self.conn.on_message(msg)
  File ".../site-packages/swampdragon/connections/sockjs_connection.py", line 90, in on_message
    raise e
ConnectionError: Error -2 connecting to /.../.redis/sock:0. Name or service not known.

I am wondering whether you already deployed sd with a redis sock and could help me out here!

Best, D

denizs commented 8 years ago

After digging deeper, I realised that the not only redis_sub_provider.py, but also redis_publisher.py is using the host attribute. Problem solved, everything is working fine :-)

I'll fork the repo and introduce an additional tag called SWAMP_DRAGON_REDIS_SOCKET, in case you're interested! Best, D