-
Notifications
You must be signed in to change notification settings - Fork 221
clients connect bu disconnect and reconnect every 3 seconds. #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
sorry, I can't follow on this. Are you sure there is no proxy or whatever in between? |
well, its all on the same computer and nginx acts in between.. its redis <-> wsgi_websocket.py <-> nginx <-> webapp, I have almost the same setup from the project documents.. except i'm using a socket and not an unix socket for wsgi_websocket and nginx because i wanted to sniff what was happening in between. |
@ezesolares , I believe that it is happening because your websocket server address:port (127.0.0.1:3032) is different from the app server (127.0.0.1:81), which conflicts with the SESSION_COOKIE_DOMAIN name. I faced the same problem when a I had to put the websocket server in a different host address. If this is your problem, this pull request must fix it: #185. More info in this issue #184. However, maybe only setting the SESSION_COOKIE_DOMAIN name fixes your problem. |
@yguarata Well, i had the same issue using unix sockets.... i changed to use sockets only to be able to sniff what was going there using tcpdump. I'll check the pull request |
Updated documentation about this: https://github.com/yguarata/django-websocket-redis/blob/master/docs/installation.rst#running-websockets-in-cross-domains |
@yguarata i added your pull request but its the same.. i tried using SESSION_COOKIE_DOMAIN='127.0.0.1' and then, also added WEBSOCKET_HOST='127.0.0.1' to my project settings and nothing changes. |
Did you try WEBSOCKET_HOST='127.0.0.1:3230'? |
I did tried, same thing
|
reading a little bit in the redis_store.py... i get a error in the nginx <-> uwsi_websocket.py communication (check the sniffing)..it says
Does that have something to do with the heartbeat that maybe is not working here? |
Can you see what happens at this line, during debug? https://github.com/jrief/django-websocket-redis/blob/master/ws4redis/wsgi_server.py#L54 When I had this problem, the server was not able to find the session_key. |
@ezesolares I also had to set the heartbeat message: WS4REDIS_HEARTBEAT = '--heartbeat--' |
Thanks for taking an interest in my case, im a lil lost I added a couple of prints because i dont know how else to debug a wsgi app... i'm getting this on console.
I'll add the heartbeat message and try |
Well, adding the WS4REDIS_HEARTBEAT fixed the disconnect issue so far, im getting the heartbeat on my webapp every 3 seconds now... i'm not sure if this would work with more latency considering that i'm testing on the same machine now. |
Its working like charm now.. i restarted the hardware today and all the changes i made thanks to this thread are working... its just ocnnected and no heartbeats all the time |
Hello.
First, thanks for a great library... now to the problem in hand
I'm having my clients keep disconnecting and connecting (every 3 seconds)
my configuration is based on the documents (redis nginx and uwsgi).
My setup is as follow
*nginx *
uwsgi
django
uwsgi --virtualenv /home/rtas/webapp/webapp/ --socket /run/uwsgi/app/hpo.com/hpo.com.socket --buffer-size=32768 --workers=5 --master --chmod=777 --module wsgi_djang
Port sniffing
nginx <-> wsgi_websocket.py
now sniffing the websocket port (nginx <-> wsgi_websocket) in port 3032
wsgi_websocket <-> redis
and the communication between wsgi_websocket app and redis (in port 6379)
I cant find the problem.. the 'NoneType' object has no attribute 'encode' that shows in the nginx <-> wsgi_django app is bothering me but i added utf-8 in the nginx setup thinking it may be that .. still cant find the right answer.
The setup is a newly installed ubuntu 15.10 with everything updated (nginx from ubuntu package, uwsgi from pip)
Thanks in advance
The text was updated successfully, but these errors were encountered: