5 ms·
> Besides, what's your proposed alternative? Setup a proper development environment that mirrors the production environment?
by planetix 9y ago
> Besides, what's your proposed alternative?
Setup a proper development environment that mirrors the production environment?
- nevi-me 9y agoIf you don't have a static IP that's internet-accessible, and that which you can arbitrarily point your domain to, how would you go about doing this? Some, if not most, services won't allow you to redirect cold to an IP address, they want some domain of sorts. There are alternatives, but I think "setup a proper dev environment" alone misses the point of what ngrok does. The 'easiest' alternative I've tried before was to VPN into my Linux box to get a static internal IP, use a spare domain for the webhook then internally redirect the webhook traffic to my local machine. In the end I'm achieving what ngrok is doing (and none of it involves setting up a proper dev environment, cos I would already have one anyways), but I'd like to hear of better alternatives :)
- tjoff 9y agoSurely you've heard of dynamic DNS?
- noway421 9y agonip.io and xip.io even could be used, but that won't help if there's no static ip. of course you can portforward your ip via vpn or ssh tunnel. And that's would be the exact equivalent of ngrok, but with way more time and frustration to set it up.
- noway421 9y agooups, meant "routable" instead of "static"
- ryanong 9y agoNgrok also works without port forwarding through a router
- floatboth 9y agoSurely you've noticed this: > don't have a static IP that's internet-accessible I am one of those people :) I don't pay my ISP extra for a "real" IP address, so I have literally no way to receive incoming connections from the internet into my home network, it's all behind their NAT.
- tjoff 9y agoYou don't need a static IP.
- krallja 9y agoYou do need a public IP.
- tjoff 9y agoAnd you probably have one at the office, or you surely do at your hosting service or ... But if you really don't then a VPS with unlimited data is cheaper than ngrok basic plan - and a lot more useful.
- deleted 9y ago[deleted]
- nevi-me 9y agoThe whole reason why I VPN into a box is that it has a static and publicly accessible IP address. Interesting that all the other alternatives proposed basically do the same thing. Point to an URL you control, and proxy traffic to where you want.
- avh02 9y agoi tend to fire up reverse port forwarding with ssh + special subdomain + ask nginx to proxy to the reverse-forwarded port on that special subdomain to resolve this, obviously you'd still need a static and public ip somewhere, but any ssh-accessible host will now do. it's a bit of setup, but works quite well once set. does _not_ provide the features ngrok does of replay, etc, but at least it's 100% your own infrastructure. edit: to clarify: no reason why it should be a special subdomain, i just use beta.mywebsite.com, just something that belongs to you and is globally dns resolvable, could be mytestdomain.com for your use. you can skip nginx if you don't mind binding to port 80 directly (i.e: no webserver already exists on that machine)
- vkjv 9y agoI do exactly this. I also have it set up with let's encrypt so that the Webhooks are encrypted. Locally, I also mirror the LE keys and add a hosts file entry for the test domain to localhost. This means I can test locally with proper ssl certs.
- avh02 9y ago+1 original reason i did it was so i can have the LE cert to test a slack bot i was developing (they require webhooks have SSL to do that)
- wgyn 9y ago> but at least it's 100% your own infrastructure This is probably a good thing for security. But for the use case of development against third party services, it seems like an unnecessary constraint.
- deleted 9y ago[deleted]
- Lazare 9y agoYes, I have that. How does that help me quickly iterate on getting proper handling for inbound webhooks from Stripe? Stripe wants a URL to send the payloads too, and my proper development environment is (not surprisingly) running inside a vagrant on my dev machine inside our office LAN. I could open up a port on our firewall and forward it through to my laptop but: 1) ngrok is easier 2) ngrok provides additional features 3) This has every drawback ngrok has and more 4) None of this has anything to do with having a proper dev environment. :) Can't reply so an edit: Yes, ngrok is actually easier than port forwarding. Plus it has logging and replay.
- tjoff 9y agoI'd imagine that for this purpose a proper dev environment would well be isolated your "office LAN". ngrok can not possibly be easier than port forwarding.
- the_mitsuhiko 9y agoExcept it is. By far. And it works everywhere. I could do webhook development on a plane.
- nickjj 9y agongrok is way easier. Run `ngrok http 3000` or whatever port your app is running on and you're done. Now you have both an HTTP and HTTPS endpoint that you can publicly access. Some webhook providing services also require HTTPS. ngrok gives you that right off the bat. Setting up self signed certs and running nginx, or faking a FQDN and using xip so that you can register a real certificate seems like overkill if all you want to do is test a webhook. ngrok is also perfect for live demo'ing apps to clients.
- fredoliveira 9y ago> ngrok can not possibly be easier than port forwarding. Oh come on, of course it can. I use port forwarding myself, but ngrok literally makes testing remote webhooks as simple as running "ngrok". That's it. It's definitely what I recommend coworkers who just want a quick solution to test out 3rd party service integrations.
- zimbatm 9y agoThat's staging, usually there is only one per project. As a developer, ngrok makes it really easy to show-off your feature branch to customers/rest of the team, regardless of your location. And you're not dependent on having a CI deploying to per-branch environments.
- mcv 9y agoYour dev environment is never going to be identical to your production environment, because you don't write code directly in production. Test and acc should be identical to prod, but for dev that's pointless.