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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Edited by Dirk83
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.