phpwebsocket

how to include the codeigniter websocket library correctly?

白昼怎懂夜的黑 提交于 2021-01-29 22:18:16
问题 I found this library to use web-socket protocol in code-igniter codeigniter-websocket and I did all the steps. I even make the same example in the description and I got this Error An Error Was Encountered Unable to load the requested class: Codeigniter_websocket 回答1: It was a bug of that package. It does not load the package library due to incorrect vendor path. This bug has been fixed. Codeigniter WebSocket Library has been updated. Please Update the library. If you face installation problem

Simple websocket in php

雨燕双飞 提交于 2020-07-22 11:06:38
问题 I want to implement a simple websocket in php with a simple response ( date / time response ). I tried this implementation but I ended up with some unknown error response. HTML - Client <html> <body> <div id="root"></div> <script> var host = 'wss://myWebsite.com:8090/simple-ws/ws.php'; var socket = new WebSocket(host); socket.onmessage = function(e) { document.getElementById('root').innerHTML = e.data; }; socket.onerror = function(e) { console.warn('Error FE', e) }; </script> </body> </html>

Laravel-websocket can't connect to Azure VM through apache2

蹲街弑〆低调 提交于 2020-06-17 15:15:19
问题 I want to implement Laravel-WebSocket + pusher substitute (https://github.com/beyondcode/laravel-websockets) with Laravel-echo on an Azure VM with apache2 reverse proxy. However, no matter what I tried, they just can't connect. It's always between error 404, 502 and 500 when a client-side listener tries to connect. This VM only allows entry through 80 and 443. Therefore, I did reverse proxy which redirects '/WebSocket' to http://127.0.0.1:6001 (where the WebSocket runs. TCP) The server is

Laravel-websocket can't connect to Azure VM through apache2

六月ゝ 毕业季﹏ 提交于 2020-06-17 15:13:12
问题 I want to implement Laravel-WebSocket + pusher substitute (https://github.com/beyondcode/laravel-websockets) with Laravel-echo on an Azure VM with apache2 reverse proxy. However, no matter what I tried, they just can't connect. It's always between error 404, 502 and 500 when a client-side listener tries to connect. This VM only allows entry through 80 and 443. Therefore, I did reverse proxy which redirects '/WebSocket' to http://127.0.0.1:6001 (where the WebSocket runs. TCP) The server is

Elephant.io Client not working

喜夏-厌秋 提交于 2020-01-24 23:46:46
问题 I've a socket.io based Websocket-Server which should get notifications from a php application. I found http://elephant.io/ which seems to be the right library for doing this. It seems that elephant.io is optimized for composer because i can't find any example for using it without them and by trying it on my own I get endless errors of includes files which are missing. So I installed composer the first time and the elephant.io packet in the folder lib\composer so all files of this library are

Update CakePhp View each time a record is inserted in the db table

烂漫一生 提交于 2020-01-06 08:04:26
问题 Am making an application that will enable remote viewing of records and reports via a browser. I have used cakePHP to make the application and its working fine,but i have one little problem,since the application does not do any inserts its just reading the data,i want when a user has opened a view and a record has been inserted on the table,it should update all open clients, instead of the user refreshing the page to get the new records. Is there a cakePHP websocket plugin that actually works

phpwebsocket - Undefined Function socket_create() - Have php_sockets enabled on Windows/WAMP

情到浓时终转凉″ 提交于 2020-01-05 05:00:37
问题 I checked out the PhpWebSockets project from here: https://code.google.com/p/phpwebsocket/ It's in its own project on my localhost (Windows 7 64-bit) box, inside of a WAMP server. I issue the following command in Windows Command Line to run the server.php file: C:\wamp\bin\php\php5.4.12\php.exe C:\wamp\www\phpwebsocket\server.php But it results in the following error message: PHP Fatal error: Call to undefined function socket_create() in C:\wamp\www\phpwebsocket\server.php on line 58 My WAMP

How to send custom HTTP header in response?

大城市里の小女人 提交于 2020-01-02 05:57:27
问题 I want to send json data in my HTTP Header. I am using Codeigniter PHP, so I did this in my controller: header('Content-Type: application/json');' This is my code: $request = array( 'request' => $_GET['request'], 'device_id' => $_GET['device_id'], 'launch_date'=> $_GET['launch_date'], 'allowed_hours'=>$_GET['allowed_hours'], 'site_id'=>$_GET['site_id'], 'product'=>$_GET['product'], 'software_version'=>$_GET['software_version'], 'platform_os'=>$_GET['platform_os'], 'platform'=>$_GET['platform'

socket_bind() [function.socket-bind]: unable to bind address [13]: Permission denied

时光总嘲笑我的痴心妄想 提交于 2019-12-25 04:42:54
问题 I am building a chat application based on websocket protocol.I am uploading this on an apache server and i am getting this error : "Warning: socket_bind() [function.socket-bind]: unable to bind address [98]: Address already in use" I am using port no. 12346. When i checked this port's status i got "12346 is not responding". I have checked many ports on my remote server ,none of them is responding.So please tell me how to check if there is a usable port which i can use?? I have also used port

Websocket client with PHP

吃可爱长大的小学妹 提交于 2019-12-25 01:57:59
问题 Hello I use the following project class: https://github.com/paragi/PHP-websocket-client When I try to connect to the websocket I have the following error: Server did not accept to upgrade connection to websocket. and in the variable $ reaponse_header I have ê☻♥Û256 My websocket works fine and the client connection works on a web browser via javascript I absolutely need to side me to the websocket as a client via php J'ai le retour suivant: Variables in local scope (#3): $address = 'ws:/