wandee / phpwebsocket

Automatically exported from code.google.com/p/phpwebsocket
0 stars 0 forks source link

code setup problem #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I follow your instruction and setup the file ( client.html and 
server.php ) and start the server. 

What is the expected output? What do you see instead?
When I go to the client in my chrome, I saw

WebSocket - status 0
in text box

and when I send message from client.html, I have this

Error: INVALID_STATE_ERR: DOM Exception 11

What version of the product are you using? On what operating system?
I'm using this one Ubuntu 10.04 Chrome

Please provide any additional information below.

Original issue reported on code.google.com by iroy2...@gmail.com on 25 May 2010 at 5:38

GoogleCodeExporter commented 9 years ago
I too have same problem. There is some problem when you run code in Ubuntu. But 
the same code is working fine in Fedora 13 + Chrome.

I guess some modification need to be done in coding.

Original comment by narendra.sisodiya on 10 Jul 2010 at 4:17

GoogleCodeExporter commented 9 years ago
I am having the same problem and I am running on OS X with Chrome 6.0.458.1 dev.

Original comment by robk...@gmail.com on 19 Jul 2010 at 12:23

GoogleCodeExporter commented 9 years ago
I just had a similar issue on Ubuntu 10.04 LTS 32-bit and Chrome 5.0.375.125 . 

But I'm using a fork of this project, namely phpwebsockets (notice the trailing 
s). Download file from this tutorial: 
http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-t
oday/ and extract it in a folder called 'socket' in your webroot. This folder 
now contains a readme.txt and the folders 'server' and 'client'. Now start the 
script in the console according to the readme (for me it was: sudo php -q 
/var/www/socket/server/startDaemon.php ). It should print 'Start listening on 
Socket.' . Leave the console window open. Now go to 
http://localhost/socket/client/client.php in Chrome (make sure you don't have 
any other tabs running, just this one). It should say 'Socket Status 0' and if 
you look in the console you see no new messages (no connection was made).

Now here comes the trick: open a second Chrome tab. Point this tab to the same 
url: http://localhost/socket/client/client.php (It also says 'Socket Status 
0'). And then close it again. Your original tab should now say 'Socket Status: 
1 (open)' and in the console you see a handshake was made. Et voila, there you 
have phpwebsockets working!

BTW it seems the script starts working exactly at the time the second tab is 
closed. Some weird behaviour by Chrome or the script, I don't know.

Original comment by ryan.bo...@gmail.com on 6 Aug 2010 at 10:01

GoogleCodeExporter commented 9 years ago
Update: just did the same trick as above but this time using Node.JS with the 
Socket.IO script (this is server-side JavaScript, not PHP). The chat example 
included in Socket.IO-node ( http://github.com/LearnBoost/Socket.IO-node ) had 
the same issue, hanging at the 'Connecting...' stage. Opening a second tab and 
then closing it again solved the problem and the chat box proceeded to load 
properly. The Node.JS server confirmed the connection in the console.

So this problem we are seeing is most likely a Chrome issue.

Original comment by ryan.bo...@gmail.com on 6 Aug 2010 at 10:31

GoogleCodeExporter commented 9 years ago
I met the same problem, but a little different.
I'm in WIN7 and Chrome 6.0.472.63.
when I connect to server, the server will say the client connected. But there's 
only "WebSocket - status 0" in client-side.
I use the trick mentioned above, but it doesn't work. The server says "done 
handshaking", but the client won't say "Socket Status: 1(open)", just "0".

Is that the problem for the new version of Chrome? I'm confused...

Original comment by kimiyaya...@gmail.com on 12 Oct 2010 at 1:44

GoogleCodeExporter commented 9 years ago
Issue 16 can work. That's cool....

Original comment by kimiyaya...@gmail.com on 12 Oct 2010 at 1:54