phpwebsocket is a server-side implementation of a WebSocket server using the PHP language. WebSocket is an API and a protocol for bi-directional, full-duplex communication that is closely associated with HTML5 and implemented in recent versions of most web browsers.
Questions tagged [phpwebsocket]
290 questions
108
votes
9 answers
Reconnection of Client when server reboots in WebSocket
I am using web socket using PHP5 and the Chrome browser as client.
I have taken the code from the site http://code.google.com/p/phpwebsocket/.
I run the server, and the client is also connected. I can chat as well.
Now when I restart the server (by…

siddhusingh
- 1,832
- 4
- 25
- 30
39
votes
4 answers
Using WebSocket on Apache server
With all the buzz around WebSockets, it's pretty hard to find a good walkthrough on how to use them with an Apache server on Google.
We're developing a plugin, in PHP (symfony2), which will run from time to time kind of a chat instance. And we find…

Edouard Reinach
- 614
- 2
- 6
- 10
28
votes
2 answers
Best practice when using websockets?
I got a webapplication written in Laravel 4. This application makes use of Ratchet and to be more specific, it uses the package Latchet. As a sidenote I am using the following techniques :
AutoBahn JS
ZeroMQ
Ratchet
Now I got the following…

Jack Sierkstra
- 1,414
- 2
- 20
- 42
16
votes
4 answers
Can't establish a connection to the server at ws://localhost:8000/socket/server/startDaemon.php. var socket = new WebSocket(host);
I am using javascript to connect websocket:
I got the error:
Can't establish a connection to the…

Sanjeev Kumar Jha
- 1,213
- 2
- 12
- 20
16
votes
3 answers
setting up websockets without command line
How can I follow a tutorial like this without using the command line?
http://www.flynsarmy.com/2012/02/php-websocket-chat-application-2-0/
I need to be able to use websockets but have a shared server and no access to the command line.
I cannot…

Max Hudson
- 9,961
- 14
- 57
- 107
16
votes
2 answers
Simple websocket server in PHP
I am developing a simple websocket server in PHP. I know there are quite a few existing implementations but I want to make my own so to learn the protocol better. I managed to do the handshaking fine and my clients connect to the server. I also…

Martin Dimitrov
- 4,796
- 5
- 46
- 62
15
votes
3 answers
How to read TLS certificates websockets using PHP?
I am trying to connect to a secure websocket created by PHP, but for some reason it doesn't work. The certificate files are readable for PHP.
This is my code so far (PHP side; stripped down code for simplicity):
$context =…

alpham8
- 1,314
- 2
- 14
- 32
14
votes
1 answer
PHP Websocket undefined in Edge Browser
I developed a multiplayer card game and therefore used a websocket. To implement the websocket in php, I used this library
I'v put it to my ubuntu server and the program works fine on Chrome Browser and in Firefox (The frontend is implemented using…

user2550641
- 317
- 4
- 18
12
votes
3 answers
'Sec-WebSocket-Accept' header is missing in Chrome 17
Edit:
I tried this phpwebsocket: http://www.wilky.it/Shared/phpwebsocket.zip and it works in Firefox, but my question still remains: how do I get websockets to work with a php server in Chrome 17?
I'm following the tutorial here:…

allicarn
- 2,859
- 2
- 28
- 47
12
votes
0 answers
WebSocket is closed before the connection is established
I am using Yii framework and OpenTok API integrated with PUSHER API. When i tired to create an instance of PUSHER event, the connection established. But few seconds later, the connection closes automatically and give error like :Pusher : Error :…

tnchalise
- 1,573
- 2
- 18
- 38
10
votes
6 answers
Socket.io installation fails on windows 7 32 bit
I installed node.js v0.8.22 and tried to install socket.io in Windows 7 32bit
Socket.io installation fails consecutively.
Console log is:
C:\Program Files\nodejs>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm…

geek2geek_AWS
- 556
- 1
- 7
- 18
9
votes
1 answer
What exactly entails setting up a PHP Websocket Server?
I'm getting into Web Sockets now and have been successfully using the online websockets Pusher(didn't like it) and Scribble(amazing but downtime is too frequent since it's just one person running it).
I've followed this tutorial…

Adarsh Sinha
- 93
- 1
- 3
7
votes
1 answer
Sending messages from PHP script to multiple Ratchet Websocket apps (via ZMQ Socket)
So, I am running a Ratchet (php) websocket server with multiple routes that connect do multiple Ratchet apps (MessageComponentInterfaces):
//loop
$loop = \React\EventLoop\Factory::create();
//websocket app
$app = new…

Erik Verboom
- 365
- 3
- 17
6
votes
1 answer
How to setup and run a PHP WebSocket service on a cpanel-based shared hosting platform?
I have created a Chat application in Ratchet PHP. It runs fine on local machine using WAMP. I want it to setup on live server.
On my server I have:
PHP Support
SSH access
Port 9000, which is opened for OutBound connections.
Sub-domains
What I…

htmler
- 380
- 1
- 4
- 12
6
votes
5 answers
How to call a WebSocket programmatically (using PHP)?
I have a situation where I need to update one browser window based on input from the other. Right now I'm using WebSockets and it's working great.
Now I want to send data to the WebSocket using PHP instead of the browser (so instead of ws://, use…

Nightwolf
- 4,495
- 2
- 21
- 29