How to generate fixed url with ngrok

梦想的初衷 提交于 2019-12-03 01:26:53

问题


I am working on facebook messenger. Facebook app only accept one url for webhook but ngrock is generating new url every time. now i am unable to test my app because of webhook url changed.


回答1:


Probably, it is not the best option for you but I started using localtunnel instead of ngrok.

An installation and run flow is very simple:

npm install -g localtunnel
lt --port <your localhost port> --subdomain youruniquesubdomain

Then I can go to my http://youruniquesubdomain.localtunnel.me That's it!


An Incredible Update

I've found Serveo just now! And it is totally incredible! No installation, no signup!

All you need to do is to run this:

ssh -R <unique subdomain>:80:<your local host>:<your local port> serveo.net

like

ssh -R youruniquesubdomain:80:localhost:8000 serveo.net



回答2:


No more free subdomain support from ngrok.....pls have a error as below

Tunnel session failed: Only paid plans may bind custom subdomains. Failed to bind the custom subdomain 'arvindpattartestfb.ngrok.io' for the account 'arvccccc'. This account is on the 'Free' plan.

Upgrade to a paid plan at: https://dashboard.ngrok.com/billing/plan

ERR_NGROK_313




回答3:


It seems ngrok has completely dropped subdomains from free tier: https://ngrok.com/product#pricing




回答4:


You need to set up auth token you can find here https://dashboard.ngrok.com/auth. (W̶o̶r̶k̶s̶ ̶w̶i̶t̶h̶ ̶f̶r̶e̶e̶ ̶v̶e̶r̶s̶i̶o̶n̶,̶ ̶n̶o̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶p̶a̶y̶ Apparently it's now paid feature, see ngrok pricing).

Then you can use it like this:

ngrok http 80 -subdomain yoursubdomain



回答5:


simply for DHIS2 local installation i did this on termainl on ubunut server.

Make sure your web is running on the specified port . mine was on 8080 .

ssh -R dani.serveo.net:80:localhost:8080 serveo.net

The beauty of this serveo.net is you can resue the same hostname..prefix url before serveo.net as many time as you want , even if power goes off or internet diconnection.

cheers!




回答6:


Though its not a solution but take it as workaround, I had the same problem while testing. What i did is keep the ngrok running with my http port, so my ngrok url is not changing. but I frequently changing and restarting my server for testing and debugging.




回答7:


You can use a custom subdomain without a paid plan, so long as you end your domain with .ngrok.io:

ngrok http 3000 -subdomain saxid-facebook-app-x9duw8b7.ngrok.io

Just be sure to pick something unique, because without a paid plan this subdomain isn't reserved and could still be taken when not in use.



来源:https://stackoverflow.com/questions/38050182/how-to-generate-fixed-url-with-ngrok

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!