winsoroaks
winsoroaks7mo ago

tools to subscribe to websocket on the backend?

Hi team! I am planning to build an app that subscribes to some trading activities using convex, what’s the best way to do it? I currently just doing a while True loop, might not be the most efficient thing. Thanks! 😅
7 Replies
Michal Srb
Michal Srb6mo ago
Do they have a webhook API in addition to a websocket one?
winsoroaks
winsoroaksOP6mo ago
yes they do. Should i just do normal fetching at 1s interval?
lee
lee6mo ago
what is the interface you can use? If you can run python or typescript or rust, you can subscribe to the query using our supported clients which use websockets
Michal Srb
Michal Srb6mo ago
If you have to fetch that's not a webhook. A webhook is the server in question fetching from your server. This is ideal for Convex, because you can define an HTTP endpoint via an HTTP action, and receive data that way.
winsoroaks
winsoroaksOP6mo ago
got it. is it possible to do so from the server? ok i see. thanks. ugh just notice that endpoint doesnt have webhook 🫠
Michal Srb
Michal Srb6mo ago
If you need another server (B) to push data to your Convex server (A), and server B doesn't provide a webhook, only a websocket connection, you'll need a different server (C) that maintains the websocket connection and sends requests to your Convex server (A).
winsoroaks
winsoroaksOP6mo ago
got it. thanks 🙂

Did you find this page helpful?