Jump to content

Triggering PHP events based on information that comes through a websocket


Dirk83

Recommended Posts

Hi,

 

I am listening to a 3rd party websocket and now I want a PHP script to be triggered when new information comes through over the websocket without sending a whole new HTTP request (though it might want to trigger an HTTP request).

 

How can I do this?

 

Thanks, Dirk

No, it is a 3rd party websocket, so the websocket is not running on the same server as the PHP script.

 

I could install a websocket on my own server though in order to send messages from the 3rd webparty indirectly through my browser client to my own web server; in the case that that is necessary.

 

Basically, when new information comes through from the 3rd party websocket I want my own server to perform calculations with the new data and possibly generate an HTTP request based on that. I am also open to suggestions to have all calculations performed on the web browser client and that the web browser client triggers an HTTP request through a javascript.

Does that clarify a bit? It is for a trading system, I listen to price data from an external web server (continuous through a websocket), then I want to perform calculations with them and if it triggers an event I want to cancel, update or place an order through an HTTP request.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.