Custom receiver not respected when when using Socket Mode
See original GitHub issueDescription
Hey friends,
I’m working on a Bolt app which uses the Adding Custom HTTP routes feature:
const { App, ExpressReceiver } = require("@slack/bolt")
const receiver = new ExpressReceiver({/* ... */})
receiver.router.get("/", (req, res) => res.send('Hello world'))
const app = new App({receiver, /* ... */})
I’m personally using this feature to serve a OAuth login flow over HTTP that works together with the Slack app to log folks into another service.
Recently, I became aware of Socket Mode, which is helpful in working around having a public webhook in my development environment.
Enabling socketMode
in the App
quietly discards my custom receiver
.
My request is two part-er:
- 🐛 BUG: It would be great if the
App
raised an error if you setsocketMode
and pass a customerreceiver
if the behaviour is to discard thereceiver
. - ⚡ ENHANCEMENT: I’m not entirely sure how this would work, but I’d like to a) use
socketMode
and b) add custom HTTP routes
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- example code related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Bug Report
Steps to reproduce:
- Create an App, add a custom receiver with HTTP routes
- Enable
socketMode
on your app - Navigate to your HTTP routes
Expected result:
The custom HTTP routes are accessible.
Actual result:
The custom HTTP routes are NOT accessible.
ps. Bolt was very straight forward to get started with and socketMode
seems quite innovative and awesome! Thanks for your hard work on this. ❤️ ❤️ ❤️
Issue Analytics
- State:
- Created 3 years ago
- Reactions:22
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Intro to Socket Mode - Slack API
Socket Mode allows your app to communicate with Slack via a WebSocket URL. WebSockets use a bidirectional stateful protocol with low latency to...
Read more >How to use Bolt events with the newer Slack API manifests?
I've now turned off socket mode and got ngrok working as described here. Slack was able to validate the url anyway. But what's...
Read more >Socket Programming in Python (Guide)
In this in-depth tutorial, you'll learn how to build a socket server and client with Python. By the end of this tutorial, you'll...
Read more >Java Client API Guide - RabbitMQ
Application developers can assign a custom name to a connection. ... If the entity does not exist, the operation fails with a channel...
Read more >4.5. TCP Socket Programming: HTTP
Processes running at the application layer of the protocol stack are not ... In this section, we will demonstrate how to use TCP...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi friends,
I have a use case that’s likely very similar to others’ – I want to use socket mode, but need to expose some custom routes (
/version
,/health
,/metrics
) for various operational reasons.This worked for me; sharing here in case it helps someone else. (Honestly, I’m a little surprised this worked, so YMMV.)
Create receiver:
Create app:
Note that I did not pass the receiver into the app.
Now just start them independently:
¯\(ツ)/¯
This feels hacky, so I’m still +1’ing the original issue. In the interim, though, hope this is useful to someone!
Support for custom HTTP routes has been introduced and will be available with the release of 3.7.0. 🙂
With #1068 and #866 now both resolved, we’re going to close this issue. Thank you to all those that participated, from upvoting to providing details around use cases! 🙏🏼