phpwebsocket

PHP Websocket on Webserver

◇◆丶佛笑我妖孽 提交于 2019-12-19 18:55:11
问题 A few days ago I setup this WebSocket server from http://code.google.com/p/phpwebsocket/ It works excellent on my localhost by using Xampp. Then, I uploaded it to my webspace on Strato, but now I am not able to connect to the server. I changed the the sockets connection to my domain but it didn`t work Client.html: var host = "ws://xxxxxxxx.com:12345/Websocket/server.php"; Server.php: $master = WebSocket("xxxxxx",12345); I already tried it with different port(80,443,12345,8080,8000....), using

Which is more efficient to send WebSocket updates with a MySQL database change

时光总嘲笑我的痴心妄想 提交于 2019-12-19 08:41:07
问题 I'm currently experimenting with WebSockets in a bid to reduce / remove the need for constant AJAX requests in a potentially low bandwidth environment. All devices are WebSocket compliant so there's no issue there, and I'm trying to keep it to native PHP WebSockets, no node.js or other frameworks / libraries (Which so far has been fine). What I'm looking to do is to decide how to go about notifying connected clients about an update to a database by another Client. The use case in question is

HTML5 WebSocket with hybi-17

你说的曾经没有我的故事 提交于 2019-12-19 04:44:34
问题 Update : I solved the decoding problem, thanks to pimvdb Follows the solution (in PHP): $len = $masks = $data = $decoded = null; $len = ord ($buffer[1]) & 127; if ($len === 126) { $masks = substr ($buffer, 4, 4); $data = substr ($buffer, 8); } else if ($len === 127) { $masks = substr ($buffer, 10, 4); $data = substr ($buffer, 14); } else { $masks = substr ($buffer, 2, 4); $data = substr ($buffer, 6); } for ($index = 0; $index < strlen ($data); $index++) { $decoded .= $data[$index] ^ $masks[

php script Bluehost Websocket server

风流意气都作罢 提交于 2019-12-13 12:48:39
问题 I'm trying to run a websocket server (php) but every time I call php-cli database.php (server file) I am given a new line and nothing happens. I try ps ax | grep websocket or database but I'm not seeing a process associated with the server. Can you help me out with running my script? Also I'm a little confounded on formatting the addresses both clientside and serverside (I've been running my test scripts on Port 9000 as per websocket tutorial) but that is a question for another time... if

Future of Socket Programming and HTML5 WebSocket and REST Combined [closed]

倖福魔咒の 提交于 2019-12-12 04:46:06
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I have created simple Socket Server in PHP and Make Chat Application with that. Socket server working on some port e.g. 127.0.0.1:9999 All clients connect with that IP:PORT and Shake-hand to server and communicate with each other. My Concept: 1) Browser => Get Real-time

Share session ID from CLI to browser

做~自己de王妃 提交于 2019-12-12 02:15:01
问题 I have a websocket connection from the browser to a php script running as a websocket server on CLI. I have the client send its session_id that was on the server i know which user has which session. It works perfectly to read the $_SESSION of the individual users. i do (on the server side [my CLI code]): $sess_ini = ini_get('session.save_path'); $save = file_get_contents("$sess_ini/sess_$sessionID"); session_id($sessionID); $sessions = explode("|",$save); $_SESSION['values'] = (isset(

ratchetphp/Pawl Connection closed (1009 - ) FRAME::CLOSE_TOO_BIG = 1009

倖福魔咒の 提交于 2019-12-11 15:29:47
问题 I'm excited to be using Pawl, and I have it working for small files (such as 350 KB). However, when I send a larger file (say, 30 MB) via $fullFileName as shown below, I get this error: Connection closed (1009 - ) . \Ratchet\Client\connect($url)->then(function(\Ratchet\Client\WebSocket $conn) use($contentType, $fullFileName) { $conn->on('message', function($msg) use ($conn) { Log::debug("Received: {$msg}"); }); $conn->on('close', function($code = null, $reason = null) { Log::debug("Connection

Closing old php websocket

喜夏-厌秋 提交于 2019-12-11 03:26:40
问题 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 error saying that the script could not bind the socket because it already exists. How can I make a script to find this old socket (given that I know which port it is running on) and close it so I can make a new connection? 回答1: If you have shell

What exactly entails setting up a PHP Websocket Server?

Deadly 提交于 2019-12-07 04:01:13
问题 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 http://www.flynsarmy.com/2012/02/php-websocket-chat-application-2-0/ on my localhost and it works great! What I wanted to ask is, how do I setup the server.php from the above file to run as a websocket server on an online webhost/shared server? Or do I need to get a

How to call a WebSocket programmatically (using PHP)?

跟風遠走 提交于 2019-12-03 13:31:41
问题 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 PHP code). In other words, I want to simulate the WebSocket.send() call using PHP instead of JavaScript. I have the following code which doesn't seem to work (the onmessage is not being called): if ( function_exists('socket_create') AND $sock =