Questions tagged [phpwebsocket]

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.

290 questions
3
votes
1 answer

access session data using PHPSESSID value

I am implementing web-socket server in php for my project. When a user will create websocket connection, it will send PHPSESSID cookie in request headers to the webserver page. I want to fetch session data for every user using their PHPSESSID cookie…
Vinit Chouhan
  • 686
  • 1
  • 10
  • 23
3
votes
0 answers

Unable to bind address (Address already in use) in PHP

I am working on chat application using websockets where I created client and server program. It is working properly on local host but as soon as I upload it to server it gives error message: Warning: socket_bind(): unable to bind address [98]:…
user3809096
  • 817
  • 1
  • 7
  • 10
3
votes
1 answer

Assign and read session of user by PHPSESSID read from cookie

I want to authenticate chat user in my php app (through websockets). Now I am sending with chat message all cookies from domain. One of these cookies is session id. Is there any option to do something like…
mitch
  • 2,235
  • 3
  • 27
  • 46
3
votes
1 answer

Does websocket only broadcasts the data to all clients connected instead of sending to a particular client?

I am new to Websockets. While reading about websockets, I am not been able to find answers to some of my doubts. I would like if someone clarifies it. Does websocket only broadcasts the data to all clients connected instead of sending to a…
ganesh
  • 1,006
  • 14
  • 30
3
votes
3 answers

Closing old php websocket

I am using PHP-Websockets to create a simple chat server. I have everything working correctly when I run the php script that creates the websocket on my server for the first time. If the script stops for some reason and I try to rerun it, I get an…
anonymousfox
  • 769
  • 2
  • 9
  • 19
3
votes
3 answers

WebSocket can't establish a connection to the server

I try to make a simple chat page on my symfony project by WebSocket. First I used React-php library, it perfectly works on terminal but when I try to connect it to browser I faced this error on chrome: Uncaught Error: INVALID_STATE_ERR: DOM…
Erfan
  • 1,132
  • 15
  • 21
3
votes
1 answer

How to fix Websocket Handshake code?

This is likely a familiar sob story. But there are so many of them out there, and I'm such a n00b I can't find the answer, so I'd like your help if you can help me. So, I'm using phpwebsocket by lemmingzshadow (google brings this up pretty easily if…
Kirk
  • 618
  • 4
  • 7
  • 21
3
votes
2 answers

Is there a way to run websockets without a server side php websocket server that runs constantly?

Let me clarify I played with phpwebsockets and see that it requires a websocket server to run forever/constantly to keep the states etc in the memory is there any way to run websockets when there is no way of running a server on the server side?
user677607
2
votes
1 answer

WebSockets on PHP shared hosting

I've been doing some research of the best way to show an "users online" counter which is updated to the second trying to avoid continuos ajax polling. Obviously WebSockets seems to be the best option. Since this is an intranet I will make it a…
Juan Ignacio
  • 3,217
  • 8
  • 33
  • 53
2
votes
0 answers

How to close websocket connection via already established websocket connection using websocket Resource Id?

I have already active connection list. I have also all active connection resource Id, I want to when click Unlock then close connection. I have try to close connection using JavaScript but it's generate new connection. var socket = new…
HEMAL
  • 420
  • 3
  • 14
2
votes
2 answers

PHP simple web socket client

I have a websocket server on AWS, currently I am connecting to this using JavaScript websockets. Is there a way to connect to the websocket server using PHP (preferably with no libraries). all I have to do is send a simple message to the websocket…
Bryan88
  • 323
  • 1
  • 2
  • 11
2
votes
1 answer

Ratchet Websockets over WSS on iis8

Spent many hour looking for the answer and there doesn't seem to be a definitive answer. I have ratchet websockets setup and running on IIS8 and this is working fine over ws:// both locally and remotely. I would now like to implement wss:// but I…
2
votes
1 answer

Laravel websockets not showing realtime stats on localhost

I'm trying to set up Laravel web sockets on my localhost but I'm having trouble getting the Real time statistics on the dashboard working. In my config/broadcasting.php I have updated the pusher array according to the Laravel websockets…
user3714932
  • 1,253
  • 2
  • 16
  • 29
2
votes
1 answer

Only one connection at a time in phpwebsocket

I am playing with phpwebsocket. Is there a way to have only one user connected at a time? If a second user tries to connect they should be automatically disconnected and if the first user is idle for a given amount of time he should be disconnected…
simonbs
  • 7,932
  • 13
  • 69
  • 115
2
votes
1 answer

PHPWebSocket library not working

So I downloaded this library: http://code.google.com/p/phpwebsocket/ and uploaded the example exactly as it is to my server. I ran it with chrome and got WebSocket - status 0 for a long time, and after that Disconnected - status 2. I checked and my…
Cokegod
  • 8,256
  • 10
  • 29
  • 47