yaddesign / phpwebsocket

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

Unable to connect to server.php #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Copied server.php and client.html
2. Started server
3. Accessed client.html

What is the expected output? What do you see instead?
WebSocket - status 0
Disconnected - status 3

What version of the product are you using? On what operating system?
Latest in SVN.

Server: Linux 2.6.32-5-xen-686, Debian, PHP 5.3.3-7+squeeze3 with Suhosin-Patch

Client: Google Chrome: 15.0.874.120 m

Please provide any additional information below.
Please note: this is on an Amazon EC2 instance. It binds to the internal IP 
address of the instance.

Server Startup:

Server Started : 2011-11-15 17:51:59
Master socket  : Resource id #4
Listening on   : 10.161.46.7 port 12345

When client connects...:
Resource id #5 CONNECTED!

Requesting handshake...
GET /phpMonitor/phpwebsocket/server.php HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: <removed>:12345
Sec-WebSocket-Origin: http://drupal-api-external.myidrupal.com
Sec-WebSocket-Key: eXMxn8VG+e8ggX8wn/dyMg==
Sec-WebSocket-Version: 8
Cookie: __utma=36081407.1633026250.1320850778.1320850778.1321373913.2; 
__utmc=36081407; 
__utmz=36081407.1320850778.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

Handshaking...
failed

Original issue reported on code.google.com by Branden....@kaosnetworks.com on 15 Nov 2011 at 6:02

GoogleCodeExporter commented 9 years ago
Forgot a line; after failed.

PHP Warning:  socket_select(): 5 is not a valid Socket resource in 
/var/www/phpMonitor/phpwebsocket/server.php on line 15

Original comment by Branden....@kaosnetworks.com on 15 Nov 2011 at 6:03

GoogleCodeExporter commented 9 years ago
I've the same problem. I think there is a problem with header, because if you 
see getheaders(..) function, it return different headers.

Original comment by masteri...@gmail.com on 18 Nov 2011 at 6:09

GoogleCodeExporter commented 9 years ago
Yes, seems there is a problem with the header. Header changed in the recent 
version of Chrome and it is trying to get the key1 and key2 that aren't present 
now:

PHP Notice:  Undefined variable: key1 in E:\dev\jm\s5designer\html\phpwebsocket\
server.php on line 144

Notice: Undefined variable: key1 in E:\dev\jm\s5designer\html\phpwebsocket\serve
r.php on line 144
PHP Notice:  Undefined variable: key2 in E:\dev\jm\s5designer\html\phpwebsocket\
server.php on line 144

Original comment by julianma...@gmail.com on 28 Nov 2011 at 3:27