Lädt...


🔧 Sharing Your Local Rails App for Development and Testing with Ngrok


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Developing an application often involves testing on your own system or with dedicated tools. But what if you need to share your progress or test features with devices not on your network?

Enter Ngrok, a powerful tool for developers! Ngrok allows you to expose your local web server to the internet securely, creating temporary URLs accessible from any device.

This guide will show you how to set up Ngrok and use it with your Rails app, streamlining your development and testing workflow.

Step 1: Sign Up for Ngrok

Head over to the Ngrok platform and create an account. On the welcome page, you'll see options for different agent types (software used to interact with Ngrok).

Welcome dashboard

Step 2: Install Ngrok (Docker Method)

For this guide, we'll use the Docker agent. However, Ngrok offers various agent types. Choose the one that best suits your environment, and follow the installation instructions provided on the Ngrok dashboard.

Here's the Docker command to run Ngrok and expose your Rails app on port 80:

docker run --net=host -it -e NGROK_AUTHTOKEN=**** ngrok/ngrok:latest http 80

Important Note: Replace "****" with your actual Ngrok auth token, which you can find in your Ngrok account dashboard.

Step 3: Ensure Firewall Permissions

Verify that your firewall allows incoming connections to the port your application is running on (usually port 80). Refer to the screenshot below for an example of firewall settings on macOS.

Firewall settings on mac

Step 4: Start Your Rails App & Configure Local Development

Launch your local Rails development server with the port mentioned in the Ngrok command output (usually port 80 in this case).

If you're using a local development environment, add the following line to your config.hosts file in config/environments/development.rb:

Ruby

config.hosts << '.ngrok-free.app'

Sharing Your App

Voila! Now you have a temporary public URL provided by Ngrok. Share this URL with your collaborators or test it on any device with an internet connection.

Advanced Ngrok Features

Ngrok offers a variety of features beyond basic tunnelling. In a future post, we'll delve deeper into exploring the full potential of Ngrok!

Thanks for reading!

Additional Tips:

Ngrok offers a free plan with limitations. Upgrading to a paid plan unlocks additional features and extended tunnel durations.
For enhanced security, consider using Ngrok with authentication methods offered in their paid plans.
This guide should get you started with Ngrok and streamline the development and testing process for your Rails app. Feel free to share your experiences and ask any questions in the comments below!

...

🔧 Sharing Your Local Rails App for Development and Testing with Ngrok


📈 64.02 Punkte
🔧 Programmierung

🔧 Cloudflare Tunnel: a free ngrok alternative for exposing local Rails apps to the internet


📈 37.23 Punkte
🔧 Programmierung

🔧 Supercharge Your Rails Development: A Deep Dive into Vite-Rails and React Integration


📈 32.19 Punkte
🔧 Programmierung

🔧 Understanding GitHub Webhooks: Leveraging Reverse Proxy with Ngrok for Local Development


📈 31.87 Punkte
🔧 Programmierung

🔧 How to Use ngrok to Expose Access to Your Local Web Server Remotely


📈 28.88 Punkte
🔧 Programmierung

🔧 Rails Designer v1.4 introduces: Beautiful Layouts for Your Rails App


📈 27.68 Punkte
🔧 Programmierung

🔧 Rails Designer v1.4 introduces: Beautiful Layouts for Your Rails App


📈 27.68 Punkte
🔧 Programmierung

🔧 Cómo Exponer un Servicio Local a Internet Usando ngrok en una Mac


📈 26.08 Punkte
🔧 Programmierung

🔧 Transforme Seu Servidor Local em um Site Público com Ngrok


📈 26.08 Punkte
🔧 Programmierung

🔧 Identify unused Routes in Ruby on Rails before Rails 7.1 and with 7.1


📈 23.6 Punkte
🔧 Programmierung

🕵️ Ruby on Rails 3.0/4.0 rails-html-sanitizer Cross Site Scripting


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Ruby on Rails 3.0/4.0 rails-html-sanitizer Cross Site Scripting


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Ruby on Rails 3.0/4.0 rails-html-sanitizer Cross Site Scripting


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Ruby on Rails 3.0/4.0 rails-html-sanitizer Cross Site Scripting


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Ruby on Rails 3.0/4.0 rails-html-sanitizer Cross Site Scripting


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Ruby on Rails 3.0/4.0 rails-html-sanitizer Cross Site Scripting


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Low CVE-2017-12098: Rails admin project Rails admin


📈 22.3 Punkte
🕵️ Sicherheitslücken

🕵️ Low CVE-2020-36190: Rails admin project Rails admin


📈 22.3 Punkte
🕵️ Sicherheitslücken

🔧 🚀Ruby on Rails for beginners: build an online store with Rails


📈 22.3 Punkte
🔧 Programmierung

🔧 How to continue to use Rails.application.secrets in Rails >= 7.2


📈 22.3 Punkte
🔧 Programmierung

🔧 How to continue to use Rails.application.secrets in Rails >= 7.2


📈 22.3 Punkte
🔧 Programmierung

🔧 Rails Designer v1.8: Ready for Rails 8 🫶


📈 22.3 Punkte
🔧 Programmierung

🎥 Android - Install and configure ngrok in Termux


📈 21.81 Punkte
🎥 IT Security Video

📰 Locator - Geolocator, Ip Tracker, Device Info By URL (Serveo And Ngrok)


📈 21.81 Punkte
📰 IT Security Nachrichten

🕵️ Russian APT29 use WinRAR Vulnerability and Ngrok in Recent Embassy Cyberattacks


📈 21.81 Punkte
🕵️ Hacking

📰 Russia’s APT29 Targets Embassies With Ngrok and WinRAR Exploit


📈 21.81 Punkte
📰 IT Security Nachrichten

matomo