Sending/Recieving Webhook requests on a local server

I’m attempting to test a discord bot and have it currently loaded up on my local machine - it uses an express server to handle webhook notifications. My question is, is it possible to run this on my local machine and still be able to send/receive requests from the twitch api? Am I allowed to use localhost:<portnumber> in a hub.callback like this? If not, is there some other way to test webhook subscriptions/access on a local machine?

      'hub.mode': 'subscribe',
      'hub.lease_seconds': 600,
      'hub.topic': `${id}`,
      'hub.callback': `https://localhost:port/twitchwebhooks/streams/${id}`,
      'hub.secret': config.hub_secret

You can’t do this

Webhooks can only be sent to a server that is web accessable

Setting the callback to localhost, sends the webhook to Twitch itself…

You could use a service such as ngrok to create a tunnel, or a reverse SSH tunnel from your live/production server

ah, ngrok should get the job done, thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.