Closed leonardodma closed 2 years ago
Hi @leonardodma,
Two quick questions:
0.2.0
had some issues in verifying the webhook but this was resolved in version 0.2.1
and 0.2.5
.Hello @tawn33y, thank you for answering so fast!
I'm using the 0.2.5
version of the library and Ngrok 3.0.6
.
The server starts running on port 3000 and sends the "hello world" message, just like in the tutorial. Then, I run ngrok HTTP 3000
and it returns a forwarding URL such as https://xxxx-xxxx-xxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx.sa.ngrok.io
. When I try to edit the webhook callbacks' URL, adding /webhook/whatsapp
to the end of Ngrok's URL, it returns that it wasn't possible to complete, and the "Webhook Verified" log does not appear in the terminal.
Server running on port ...
?https://your-xxx.xx.ngrok.io
and see if it returns an error or simply "404"? Also try https://your-xxx.xx.ngrok.io/webhook/whatsapp
It does appear "🚀 Server running on port 3000...". In my browser accessing my Ngrok's URL, GET /
returns 404 Not Found, while GET /webhook/whatsapp
returns 403 Forbidden.
This shows that it's running fully OK locally, and ngrok is working as well.
Can you share the url you're providing in the App dashboard? I hope it's something like https://xxx.ngrok.io/webhook/whatsapp
It is a little bit different (probably because of the Ngrok version): https://d0f2-2804-431-cff6-9331-241a-5639-ede4-a314.sa.ngrok.io
. Anyway, I've tried to use Local Tunnel and it didn't work either.
Ah, seems like there is a new feature that ngrok has introduced to show a browser warning on visiting each page, requiring a user to confirm "Visit page" before loading the page: https://blog.ngrok.com/posts/fighting-abuse-on-the-ngrok-platform
I think what's happening is that Facebook is trying to hit your ngrok endpoint and gets served by html content requiring confirmation, which obviously means that Facebook will fail to verify your webhook.
I wasn't aware that ngrok introduced this. I'm personally using ngrok version 3.0.4
and it doesn't have this feature. Perhaps you can try downloading an earlier version instead?
You can use docker: https://hub.docker.com/r/ngrok/ngrok
Something like: eg:
docker run -it ngrok/ngrok:3.0.3-debian http 3000
And then try to verify the webhook.
Curious to see if this works.
I think you got it! Make totally sense! I will try to run with the 3.0.4 version!
I tried to run docker run -it ngrok/ngrok:3.0.3-debian http 3000
but I got the following log (despite server is still running):
How about this:
docker run --net=host -it ngrok/ngrok:3.0.3-debian http 3000
Running the following command, I was able to connect to the port, but the verification is still happening :(
docker run --net=host -it -e NGROK_AUTHTOKEN=[NGROK_TOKEN] ngrok/ngrok:3.0.3-debian http 3000
What url are you getting now? Can you share? Need to confirm if I'm seeing the "Verify site" browser warning page.
Also, what error are you getting now?
I'm getting this URL: https://7052-187-34-95-187.sa.ngrok.io
. It returned the confirmation page firstly, but then got the same error failed to establish a connection to the upstream web service at [localhost:3000](http://localhost:3000/)
Quick question: can you try running this without supplying the auth token?
Sure! https://7652-187-34-95-187.sa.ngrok.io
I'm starting to feel that this might be quicker via a call. Feel free to send a calendar invite for tomorrow. I will respond accordingly if the time doesn't work for me.
(for future reference) There are 4 solutions off the top of my mind for fixing this:
ngrok-skip-browser-warning
header in the requests it sends to our webhook, but it seems this is currently not supported: https://developers.facebook.com/community/threads/733910894547222/./ngrok http 3000
. This worked perfectly fine and didn't bring a Verify Site interstitial page.ngrok config add-authtoken <token>
and tried running it again. This time the Verify Site interstitial page appeared.~/.ngrok
, ~/.config/ngrok/ngrok.yml
), and run it again with the assumption that I wouldn't be logged in. On running it however, I now encountered an error that I need to sign up for an ngrok account before continuing (ERR_NGROK_6022
). I created fresh config files with no assigned value for auth token, but still got the same error. Perhaps there's another config file I'm missing, but it seems you are unable to go back to running it as a fresh installation. docker run --net=host -it ngrok/ngrok:3.0.3-debian http 3000
but still got the auth error: ERR_NGROK_6022
.Seems a person may need to pay for ngrok or localtunnel for now; at least until Facebook allows the use of custom headers in requests. Any other solutions are most welcome. Will mark this as closed for now.
Hi there! I had no success trying with older version of ngrok (tried 3.0.1) and with ngrok alternatives that doesn't show 'verification page' (pagekite and localtonet). In both alternatives I was able to successfuly browse my local instance without verification page, but when trying to set this as my webhook in FB developers page my instance got untouched and, obviously, I could not set it as my webhook addres. This might be some FB thing. It's a shame I have to deploy my app to be able to test...
could you solve this ? @guskuma
Hey @TGw44 I had no luck yet. Next weeks I'll try again and I'll let you know if it works.
I have good news @guskuma , i made it work without ngrok!
I used Heroku instead.
Here is great video step by step. https://www.youtube.com/watch?v=HY7Px7wWfq4
Note: i had to change startExpressServer.js line 100
const port = (options === null || options === void 0 ? void 0 : options.port) || 3000; to const port = (options === null || options === void 0 ? void 0 : options.port) || process.env.PORT || 3000;
Maybe we can add this alternative in the TUTORIAL @tawn33y
Sure thing, I'll create an issue for this for tracking
Hello everyone, i have read all comments in this issue and i thought finally i found a solution for webhook with using heroku. But when i check the heroku page i see there is no free option anymore. So is there any progress about this situation? How we going to verify?
Ok guys, we can use telebit.io instead of other tunnels. It's works now
@ernsk How did u achive with telebit.io, im only watching the reverse form, from a page to a locahost Can u give me any advise
I success to do it with loophole.cloud
I followed all the steps in the tutorial section and I was able to send messages, but my webhook endpoint was not verified. I've tried many ways, and the only way that works is using Glitch, as recommended in the API documentation. Do you know any solution that could solve my issue?