php-websocket-client's Issues
could not connect, syntax error
Parse error: syntax error, unexpected ')' in websocket-client.php on line 85
after manually fix:
Warning: stream_socket_client(): unable to connect to 443 (Failed to parse address "443")
send message from php to websocket #145
Hello.
I have a connection created from javascripts successfully towards my websocket server. I send messages and receive the perfect response. I am using the cboden/ratchet library.
Now what I need is to save a message in the database, to be able to send a message from php to the websocket server so that it sends it to the chat. I can't do this.
I've tried the sample code but I can't do anything. Can you guide me a bit?
Thank you.
try {
$sp = new \Paragi\PhpWebsocket\Client('localhost?idphonenumber=' . $phone->idphonenumber, 9235);
$sp->write("hello server");
echo "Server responded with: " . $sp->read();
} catch (\Paragi\PhpWebsocket\ConnectionException $e) {
echo "Something gets wrong " . $e->getMessage();
}
Cant seem to connect to Ratchet thru ProxyPass with ssl
Any ideas?
[Bug] stripos instead of strpos and resolve compare
- Must used
=== false
instead of!
forstrpos
.
Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.
ref
- I've seen it sometimes return
sec-websocket-accept
so must be usedstripos
instead ofstrpos
for case-insensitive
PHP-websocket-client/websocket_client.php
Line 117 in cefdf41
cant connect with wss/::
Hi dear,
I was trying to connect with MEWS socket which host is ''wss://ws.mews-demo.com/ws/connector''. the server must need the keys into cookie. i just added that into headers.
but i am getting the error:
Warning: stream_socket_client(): unable to connect to wss://ws.mews-demo.com/ws/connector:443 (Unable to find the socket transport "wss" - did you forget to enable it when you configured PHP?) in C:\xampp\htdocs\PHP-websocket-client\websocket_client.php on line 101
I need a help badly. Thanks.
my code of example.php
[Feature] Set custom path in the header
Currently just can be send request for /
path.
Needed set custom path in the header after GET
PHP-websocket-client/websocket_client.php
Line 70 in cefdf41
read method mistyped
$payload_len += ord($header
needs to be $payload_len += ord($ext
in websocket_read
read method problem, Reading header from websocket failed
[Question] Is there a way to setup websocket without terminal?
Hi Paragi,
Seems like a really simple websocket client just what I needed, but can I need this to use only to send a notification to the dashboard when clients makes a payment in frontend, so is it possible to run websocket server without terminal for example when the clients starts the session on my site?
Thanks and Regards,
Berat
[Question] check connection status
Hi Paragi,
Really good class for PHP. I started using it, however I only use this class to send notifications (one-way) from my server to another websocket server. The only problem I am facing right now is that if for some reason the connection has beed dropped I have to restart my PHP server script because it has to reconnect to the server( websocket) again.
Is there a way to check if connection is alive or it was dropped , so I can reconnect using websocket_open ?
My scenario is:
I open new connection with websocket_open
and then I send notifications using websocket_write
but if in the meantime connection is dropped, my websocket_write function shows ERROR messages that it was unable to send messages? I want to check the connection before writing
how to send GET requets body?
[Bug] `persistant` set to true for basic example
I see in the basic example, the persistant
param must be true
about echo.websocket.org
sample server for works it.
PHP-websocket-client/example1.php
Line 7 in cefdf41
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.