Choosing a protocol to connect to Slack
Your app is in constant, bidrectional communication with Slack—sending messages, listening for responses, and interacting with users.
Here's an overview of the choice you have in how you communicate with Slack.
When you use the Events API directly over HTTP, Slack calls you.
You designate a public HTTP endpoint that your app listens on, choose what events to subscribe to, and voilà: Slack sends the appropriate events to you.
Sometimes, you can't—or don't wish to—create a static HTTP endpoint for Slack to communicate with your app.
You might be developing behind a corporate firewall, or you might simply have security concerns with that setup.
Even if you're just getting started or only building something for your team, using an SDK with Socket Mode is the quickest way to work with the richest set of Slack platform features.
Socket Mode allows you to receive events through a private WebSocket, instead of a direct HTTP subscription to events.
By listening on that URL, your app can use the Events API and interactive features of the Slack platform as normal—but you'll receive payloads through that WebSocket URL, constructed at runtime, rather than a static HTTP endpoint.
Socket Mode can be toggled on or off. Whenever you toggle Socket Mode on, you'll only receive events and interactive payloads over your WebSocket connections—not over HTTP.
The outmoded Real Time Messaging API provides a raw feed of information from Slack.
We recommend using Socket Mode for new apps.