0

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 !

Community
  • 1
  • 1
n.sh
  • 347
  • 4
  • 19

1 Answers1

0

found the problem :|

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

must change to

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

n.sh
  • 347
  • 4
  • 19
  • Could you provide more details? Show all your code fro this file please – anatol Jul 17 '17 at 04:12
  • hello @anatol . i managed to connect to ngrok virtual server , but my whole attempt for running telegram using webhook was a failure so i forget about it and choosed the echo mode . – n.sh Jul 17 '17 at 11:40