How do I run a Ruby project on localhost and on the internet at the same time?

I am currently developing a web service using Ruby on Rails. I want to run it both on the local network and on the internet at the same time? How can I do that?

+3


source to share


3 answers


I guess

  • You want you to show a product running on your local computer to a person on the Internet.

OR

  • You are trying to check IPN Paypal notification.

1) Install proxylocal gem

gem install proxylocal

      

2) Start the rails server in development mode.

3) Start proxy local



$ proxylocal 3000 --host joshi_server
Local server on port 3000 is now publicly available via:
http://joshi_server.t.proxylocal.com/

      

Now you can access your local server using http://joshi_server.t.proxylocal.com/

anywhere on the Internet.

Note

Similar services

Free: localtunnel , pagekite , yaler ,

Paid for: showoff.io

I found that proxylocal

, localtunnel

and showoff

wrt are similar in ease of use and reliability. I prefer proxylocal

it as it allows me to name and reuse a subdomain for my local server.

Don't use this approach to set up production

+4


source


Allow access to the server over the local network and the Internet, or configure two servers pointing to the same database. Rails runs multiple instances anyway, so you won't have any corrupted data.



+1


source


If you mean "how can I make my local web server also accessible from the public internet", then an easy way to get started is to set up an SSH tunnel from a suitable remote host like a VPS or another server to your local machine.

You need to make sure that your configuration sshd

allows tunnel ports to be opened as they are limited by default.

0


source







All Articles