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
Do they have a webhook API in addition to a websocket one?
yes they do. Should i just do normal fetching at 1s interval?
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
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.
got it. is it possible to do so from the server?
ok i see. thanks. ugh just notice that endpoint doesnt have webhook 🫠
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).
got it. thanks 🙂