n.sh
n.sh

Reputation: 384

setting up telegram bot webhook with ngrok 502 Bad Getaway

i tried to set up the bot with ngrok like the webhook sample, and this is how:

       using (WebApp.Start<Startup>("localhost:5229"))
        {
       
            Bot.Api.SetWebhook("https://sd52w84s.ngrok.io").Wait();

            Console.WriteLine("Server Started");

       
            Console.ReadLine();

      
            Bot.Api.SetWebhook().Wait();
        }

but the ngrok console log 502 Bad Getaway error, and seems like the server is not running at localhost:5229

also this is the error from postman:

Failed to complete tunnel connection

The connection to https://sd52w84s.ngrok.io was successfully tunneled to your ngrok client, but the >client failed to establish a connection to the local address localhost:20.

Make sure that a web service is running on localhost:5229 and that it is a valid address.

The error encountered was: dial tcp [::1]:5229: connectex: No connection could be made because the >target machine actively refused it.

how can i make sure that the server is running? any help would be appreciated !

Upvotes: 0

Views: 2635

Answers (1)

n.sh
n.sh

Reputation: 384

found the problem :|

using (WebApp.Start<Startup>("localhost:5229"))

must change to

using (WebApp.Start<Startup>("http://localhost:5229/"))

Upvotes: 0

Related Questions