Comments (28)
with these changes the application was running.
-$master=WebSocket("localhost",12345);
+$master=WebSocket("0.0.0.0",12345);
-if ($spaces1 == 0 || $spaces2 == 0 || $numkey1 % $spaces1 != 0 || $numkey2 %
$spaces2 != 0) {
+if ($spaces1 == 0 || $spaces2 == 0 || fmod($numkey1, $spaces1) != 0 ||
fmod($numkey2, $spaces2) != 0) {
-$r=$h=$o=null;
+$r=$h=$o=$key1=$key2=$data=null;
only strange action on disconect, I will check the code for my own application.
Original comment by [email protected]
on 20 Jun 2011 at 9:28
from phpwebsocket.
yes! work!
Original comment by [email protected]
on 18 Jul 2011 at 7:08
from phpwebsocket.
Super! Now the client connects always!!
Original comment by [email protected]
on 22 Jul 2011 at 1:26
from phpwebsocket.
I've the same problem since yesterday, my sysadmin mada a major update of the
centos server and now my phpwebsocket server is not running.
PHP Warning: socket_select(): 6 is not a valid Socket resource in
/var/www/websocket/server.php on line 15
I made all the changes suggested and still doesn't work.
Any idea?
Original comment by [email protected]
on 20 Sep 2011 at 7:15
from phpwebsocket.
Strange behaviour:
I am testing completely on localhost but on two PCs
both: WindowsXP,SP3 - nginx1.0, php5.3.3, chrome14
One works always, one doesn't - all the time. I am
confused now.
Original comment by [email protected]
on 20 Sep 2011 at 9:44
from phpwebsocket.
Sorry if I confused you also: each of my environments
are chromebrowser and server nginx+php in each case on
one machine. One server-client-windows works always, the
other never. All files/setups etc are cloned (via dropbox)
and therefore are similar. I can't find a significant
difference.. but I will tell you, if I find it..
Original comment by [email protected]
on 20 Sep 2011 at 10:59
from phpwebsocket.
I see that the now, the websocket headers are like this:
GET / HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: www.xxxxxx.com:12345
Sec-WebSocket-Origin: http://www.xxxxxxxxx.com
Sec-WebSocket-Key: kYuC/SdNC0WoNCLLTm/sZA==
Sec-WebSocket-Version: 8
Only one key, no more key1 and key2.
How I do the handshake?
Original comment by [email protected]
on 20 Sep 2011 at 9:20
from phpwebsocket.
[deleted comment]
from phpwebsocket.
Additional from me: The difference between my two
setups (see above) is Chrome13 on the working PC
and Chrome14 on the never working one. I upgraded
to Chrome14 on the first setup and now both are
never working..
So I googled that Chrome14 (and15) implements the
"ietf-hybi-10" spec and Chrome13 is using some
older spec. I think the handshake is now working
some different.. (?)
Original comment by [email protected]
on 21 Sep 2011 at 10:34
from phpwebsocket.
I'm running on XAMPP 1.7.1 on Windows 7.
I did all the changes mentioned above, in my file "server.php"
But the error is still recurring. Help, please!
Original comment by [email protected]
on 11 Oct 2011 at 9:12
from phpwebsocket.
Well the quick answer is available but spread in this project home. The HTTP
connection string slightly changed and Google Chrome changed this AFAIK in
version 14 as well. Therefore all (well almost all) examples concerning
WebSockets are no longer working. Comment 4 in Issue 35 is providing the new
version of the HTTP protocol as well a possible implementation of the newly
introduced sub-protocol.
Issue Details:
http://code.google.com/p/phpwebsocket/issues/detail?id=35#c4
The new protocol / sub-protocol explained in the current draft:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#section-5
Original comment by [email protected]
on 12 Oct 2011 at 7:01
from phpwebsocket.
This is my first experience with web sockets, Whenever i point my browser to
client.php, it prints this message in chatbox
WebSocket - status 0
Disconnected - status 3
And on command line, getting these errors,
Notice: Undefined variable: key1 in D:\xampp\htdocs\socket\server.php on line
143
Notice: Undefined variable: key2 in D:\xampp\htdocs\socket\server.php on line
143
Warning: socket_select(): 5 is not valid Socket resource in
D:\xampp\htdocs\socket\server.php on line 15
I am using windows with xampp PHP 5.3.8 on both client and server side
and facing these errors.
Please help
Original comment by [email protected]
on 2 Apr 2012 at 2:53
from phpwebsocket.
I am experiencing the same ... as above.
erver Started : 2012-05-27 12:59:53
Master socket : Resource id #4
Listening on : localhost port 12345
Notice: Undefined variable: key1 in /Library/WebServer/Documents/server.php on
line 143
Notice: Undefined variable: key2 in /Library/WebServer/Documents/server.php on
line 143
I understand the issue, does anyone have a resolution?
Original comment by [email protected]
on 27 May 2012 at 6:05
from phpwebsocket.
I am running PHP 5.4.1 on Windows 7 64bit.
I downloaded the code as it is now and ran this in command line from the
phpwebsocket folder:
php server.php
This is what I get:
Server Started : 2012-05-29 15:30:37
Master socket : Resource id #4
Listening on : localhost port 12345
PHP Strict Standards: Only variables should be passed by reference in C:\Users\
mike_2\Desktop\webhome\phpwebsocket\server.php on line 15
Then I open the client in Chrome 19.0.1084.52
I get this in the browser:
WebSocket - status 0
Disconnected - status 3
In the command line I see:
Notice: Undefined variable: key1 in C:\Users\mike_2\Desktop\webhome\phpwebsocket
\server.php on line 143
PHP Notice: Undefined variable: key2 in C:\Users\mike_2\Desktop\webhome\phpwebs
ocket\server.php on line 143
PHP Strict Standards: Only variables should be passed by reference in C:\Users\
mike_2\Desktop\webhome\phpwebsocket\server.php on line 15
Warning: socket_select(): 5 is not a valid Socket resource in C:\Users\mike_2\De
sktop\webhome\phpwebsocket\server.php on line 15
What can we do to fix this. Is it an updated php problem?
Original comment by [email protected]
on 29 May 2012 at 9:36
from phpwebsocket.
I am running PHP 5.3.9 on Windows xp
I downloaded the code as it is now and ran this in command line from the
phpwebsocket folder:
php server.php
This is what I get:
Server Started : 2012-05-29 15:30:37
Master socket : Resource id #4
Listening on : localhost port 12345
Then I open the client in Chrome 19.0.1084.52
I get this in the browser:
WebSocket - status 0
Disconnected - status 3
In the command line I see:
Warning: socket_select(): 5 is not a valid Socket resource in C:\Users\mike_2\De
sktop\webhome\phpwebsocket\server.php on line 15
What can we do to fix this. Is it an updated php problem?
Original comment by [email protected]
on 30 May 2012 at 12:15
from phpwebsocket.
Same issue here. I tried with the suggested solution posted by on comment #1
but the problem did persist.
Any known reason for this?
Original comment by javier.galvez.guerrero
on 28 Jun 2012 at 7:32
from phpwebsocket.
idem
Notice: Undefined variable: key1 in D:\mywamp\wamp\www\websocket\server.php on
line 144
etc...
actually lastest browsers use only 1 key.
Request:
GET /websocket/server.php HTTP/1.1
Host: localhost:12345
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive, Upgrade
Sec-WebSocket-Version: 13
Origin: http://localhost
Sec-WebSocket-Key: WEdh0Gy0k5z39/VfN9lvFQ==
Cookie: __utma=111872281.1222847165.1325647875.1325647875.1325647875.1;
__utmz=111872281.1325647875.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
PHPSESSID=niv88e5dbmnvc0ogvjcusufb44
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
There is an 'Update' linked at comment 11.
But there others errors when launching 'demo.php':
Deprecated: Call-time pass-by-reference has been deprecated in
D:\wamp\www\websocket\server\websocket.class.php on line 241
Server Started : 2012-06-28 21:21:33
Listening on : 0 port 12345
Master socket : Resource id #10
Fatal error: Class 'Uri1ResourceHandler' not found in
D:\wamp\www\websocket\demo.php on line 12.
thanks.
Original comment by [email protected]
on 28 Jun 2012 at 9:23
from phpwebsocket.
Apparently upon debugging I found that whenever I get "Warning:
socket_select(): 5 is not a valid Socket resource" error, the number that is
printed out is the resource id of the socket. Maybe the socket_accept is not
creating a valid socket resource?
Original comment by [email protected]
on 21 Jul 2012 at 1:52
from phpwebsocket.
Same for me.
Any solution ?
Original comment by [email protected]
on 28 Jul 2012 at 7:53
from phpwebsocket.
PHP Notice: Undefined variable: key1 in /var/www/game/server.php on line 142
PHP Notice: Undefined variable: key2 in /var/www/game/server.php on line 142
PHP Warning: socket_select(): 5 is not a valid Socket resource in
/var/www/game/server.php on line 14
how can i solve it?
Original comment by [email protected]
on 10 Nov 2012 at 8:04
from phpwebsocket.
Any solutions for the "...is not a valid Socket resource in..." "...on line
15..." ? I am not quite sure what needs to be changed in order for the demo to
work out of the box.
Original comment by [email protected]
on 12 May 2013 at 5:51
from phpwebsocket.
Same here: PHP Warning: socket_select(): 5 is not a valid Socket resource in
/var/www/websocket/server.php on line 15
Anybody found a cure?
Original comment by [email protected]
on 24 Jul 2013 at 3:18
from phpwebsocket.
I also got these problems but with the changes it worked fine on localhost.
Only if I want to access the script with my other computer it appears again in
console and I get "disconnected - status 3". Can't find any reason/solution...
Original comment by [email protected]
on 3 Jul 2014 at 1:24
from phpwebsocket.
[deleted comment]
from phpwebsocket.
[deleted comment]
from phpwebsocket.
Had the same error and got a connection with this solution:
Just use the attched server.php.
Source:
http://phpforum.de/forum/showpost.php?p=1502477&postcount=13
Original comment by [email protected]
on 11 Sep 2014 at 2:47
Attachments:
from phpwebsocket.
thanks the server.php from #26,i run it on my platform
Original comment by [email protected]
on 31 Mar 2015 at 3:05
from phpwebsocket.
Got the server running and it works but it does give me an error I'm curious
about:
Strict Standards: Only variables should be passed by reference in C:\xampp\htdoc
s\test\server.php on line 15
Original comment by [email protected]
on 22 Apr 2015 at 2:08
from phpwebsocket.
Related Issues (20)
- Patch for /trunk/ phpwebsocket/websocket.class.php
- Decode broken when multiple calls same time
- Use on own Webspace on Strato
- what is" function $ (id)" is exactly doing in client code?
- update new version
- can't run the app
- Running on windows HOT 1
- Several Clients
- Patch for /trunk/ phpwebsocket/server.php
- Space ' ' in directory name
- on send button click getting InvalidStateError HOT 1
- Getting weird characters at the server side. HOT 1
- Patch for /trunk/ phpwebsocket/server.php
- Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing HOT 1
- Patch for /trunk/ phpwebsocket/client.html
- Patch for /trunk/ phpwebsocket/websocket.class.php
- Patch for /trunk/ phpwebsocket/server.php
- Patch for /trunk/ phpwebsocket/client.html
- Patch for /trunk/ phpwebsocket/chatbot.demo.php
- socket_tcp_bind: tcp_socket: Can't assign requested address
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpwebsocket.