3 ms·
Websockets? That means the Reddit bot will be listening from a webpage? Is that how Reddit bots operate? I'm confused, I thought Reddit bots would be a normal c
by fiatjaf 11y ago
Websockets? That means the Reddit bot will be listening from a webpage? Is that how Reddit bots operate? I'm confused, I thought Reddit bots would be a normal computer process, listening/polling for content and making HTTP calls to the API, nothing from a web browser. Someone please explain it to me!
- rtheunissen 11y agoNot necessarily from a webpage. Web browsers support [1] what's called the WebSocket API [2], which allows browsers to create socket connections to a socket server. But many programming languages also provide a library to create socket connections on the server. This is what most reddit bots would be doing, as demonstrated in the rockets-client [3], which uses a Node.js websocket library called 'ws'. So it's incredibly flexible. You could wrap a UI around it in the browser, or use it server-side with any mainstream programming language that supports websockets. [1] http://caniuse.com/#feat=websockets http://caniuse.com/#feat=websockets [2] http://www.websocket.org/aboutwebsocket.html http://www.websocket.org/aboutwebsocket.html [3] https://github.com/rtheunissen/rockets-client https://github.com/rtheunissen/rockets-client
- fiatjaf 11y agoThank you very much.