WebFaction
Community site: login faq

I'm trying to use django-websocket-redis on webfaction, what I have done so far:

  1. Created a redis custom app in webfaction (installed using this guide) which works
  2. Installing django-websocket-redis and creating the necessary changes in my django app, for example pointing to the right redis port
  3. Installing nginx (1.7.7) and uWSGI (2.0.8) (install done using the previous community question)
  4. Requested a second ip from webfaction to serve the redis application, which is now used as the host for django-websocket-redis. Django is able to connect to it.

I'm trying to get this basic chat working: http://directles.nl/chat/ But it endlessly keeps connection to the socket, I'm out of debugging options.

I'm completely new to websockets, so if someone could point me in the right direction, that would be a great help!

Thanks in advance!

EDIT: When a message is entered in the chat it shows up in the redis keys, but not on the actual website.

asked 24 Nov '14, 13:48

agregorian
1124
accept rate: 0%

edited 24 Nov '14, 14:23


You shouldn't need a second IP for Redis. Just create a 'custom app listening on port' application and run Redis on its assigned port.

When you install Nginx and uWSGI (ie, as you did in step 3 above) you'll need to make some changes to get things configured as shown in Django with WebSockets for Redis behind NGiNX using uWSGI.

Specifically:

  • You'll need to create a 'custom websockets app listening on port' application, instead of a basic 'custom app listening on port' application, for your Nginx port.
  • You'll need to edit your nginx.conf to include a location block for the /ws/ URL.
  • You'll need to edit the bin/start script to start the two separate uWSGI instances
  • You'll need to edit the bin/stop script to stop the two separate uWSGI instances

Hope that helps!

permanent link

answered 24 Nov '14, 20:29

seanf
12.2k41836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×12
×5

question asked: 24 Nov '14, 13:48

question was seen: 3,166 times

last updated: 24 Nov '14, 20:29

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM