I am trying to use curl to make a permanent connection, just like websockets .. where, once the connection is established, the client and server simply send small text messages instead of a new HTTP request each time.
For a websocket request, I can do a handshake and receive messages from the server (the connection remains open). only problem is curl not sending anything with the header "HTTP / 1.1".
Each time curl_exec starts up, curl sends "GET / HTTP / 1.1". This is not required after the connection is established.
I can use the custom curl request parameter to send my message, but that would form a header, for example "message / HTTP / 1.1".
It would be great if there was a way to eliminate this "HTTP / 1.1" from the header.
I know php sockets are the best option, but I'm just wondering if there is a hacky way to do this (maybe a websocket client) using curl ..
Any ideas?
source
share