nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.82k stars 305 forks source link

websockets test not working at all #49

Open pablochacin opened 12 years ago

pablochacin commented 12 years ago

When testing the webdis build of "Jul 1 22:41:04 2012" with Redis 2.5.11 on Ubuntu 11.04 I've found that the websockets tests doesn't work at all.

Running the websocket test gives this result:

$> ./websocket  -v
ret=0
ret=0
ret=0
ret=0
No message was read.

Opening the websocket.html page shows the "loading" message but nothing happens.

Other tests work fine, so I don't believe it has to do with redis itself and, to the extend of what I understand of webdis, the websocket in a fully webdis side mechanism, which doesn't rely on any redis support.

Regards

Pablo

nicolasff commented 12 years ago

Hello Pablo,

Thanks for reporting this; I'm closing it as a duplicate of #49, let's keep the conversation there.

Regards,

Nicolas

pablochacin commented 12 years ago

Hi Nocolas

This issue you closed is the #49. Which one does it duplicate?

Pablo

On 07/06/2012 12:17 AM, Nicolas Favre-Felix wrote:

Hello Pablo,

Thanks for reporting this; I'm closing it as a duplicate of #49, let's keep the conversation there.

Regards,

Nicolas


Reply to this email directly or view it on GitHub: https://github.com/nicolasff/webdis/issues/49#issuecomment-6792387

nicolasff commented 12 years ago

@pchacin oops, that was #50. Reopening this one.

PhE commented 12 years ago

What is the expected output of ./websocket -v ? When I run, it hangs without displaying anything :

$ ./websocket -v

When I run, it without webdis I get :

$ ./websocket -v
connect: ret=-1: Connection refused
connect: ret=-1: Connection refused
connect: ret=-1: Connection refused
connect: ret=-1: Connection refused
No message was read.

When I shut down webdis while it is running I get :

$ ./websocket -v
ret=0
ret=0
ret=0
ret=0

When I shut down redis while it is running I get :

$ ./websocket -v
ret=-1
ret=-1
ret=-1
ret=-1
No message was read.
PhE commented 11 years ago

websocket not working is turning to a big issue for me :-/ We have to use an old Chrome version (18) on windows to make it work and it is not easy to get on old Chrome version installer. On Linux this is even worth : there is no way to get on old Chrome version on a recent distribution. Is there any plan to make the websocket feature work again ?

RichardJohnn commented 11 years ago

does this just not work at the moment? that would explain it! ./websocket -v just hangs whether i close redis before or after or leave it running.. and if i publish something..going to the site says it cannot connect to ws://whathaveyou:7379

please give a heads up if i can see this work!! thank you i dig this concept

RichardJohnn commented 11 years ago

whoa! if i just run webdis instead of the websocket program, the websocket.html page loads everything up fine. (i did set websockets to true in the .json) this is using Chromium Version 20.0.1132.47 and Firefox 16.0.1

I think you should remove the websocket program, unless I just dont understand what its for.. it lead to two afternoons of confusion, hoho!

b1c9g76 commented 11 years ago

(NB: Newbie here)

Similar to this, I modified the test to issue a SUBSCRIBE and I get back a subscribe reply as expected and then the websocket closes straight away. I was expecting it to stay up similarly to issuing the same SUBSCRIBE through a webbrowser where it stays open and recieves data as PUBLISH commands are issued.

What am I missing?

var jsonSocket = new WebSocket("ws://127.0.0.1:7379/.json"); jsonSocket.onopen = function() { console.log("JSON socket connected!"); jsonSocket.send(JSON.stringify(["SUBSCRIBE", "test"])); }; jsonSocket.onmessage = function(messageEvent) { console.log("JSON received:", messageEvent.data); }; jsonSocket.onclose = function() { console.log("JSON closed"); };

Console output:

JSON socket connected! test.html:55 JSON received: {"SUBSCRIBE":["subscribe","test",1]} test.html:60 JSON closed

konklone commented 11 years ago

Does commit 2cfc27dacc300e499ca16d0524576c4512460a2d fix this?