Posted almost 5 years ago. Visible to the public.

Advantages of using appname.daho.im:3000 over localhost:3000

Running rails server will start a local server that you can access via http://localhost:3000.

When you are working on multiple web apps, they will likely set cookies with generic names on localhost. This is annoying, since you will sign out your current user whenever you switch to another app.

A better way is to use our own daho.im service. All daho.im subdomains resolve to your local IP (127.0.0.1). That means you can use a different hostname for different apps, and you will stay logged in in each app:

Copy
http://foo-app.daho.im:3000 => 127.0.0.1 http://bar-app.daho.im:3000 => 127.0.0.1 http://bam-app.daho.im:3000 => 127.0.0.1

Caution

It's safe to use daho.im since it's our own domain. Don't use external services like vcap.me because we can't guarantee someone doesn't change DNS. Also do not hard-code the domain into 100 different config settings. Instead, define it in a single place so switching it out will be easy.

In practice it is helpful to have a bash alias to generate the vcap.me link for you. This way it is also ensured that you always get the same link for a project. Have the following line in your .bashrc:

Copy
alias dahoim='echo "http://$(basename $PWD).daho.im:3000"'

From a project directory (e.g. foo-app) this command will print the link to console that you can click on (ctrl + click):

Copy
~/foo-app $ dahoim http://foo-app.daho.im:3000

You can also use the following to directly open a browser with the URL:

Copy
alias dahoim-open='nohup xdg-open "http://$(basename $PWD).daho.im:3000" > /dev/null 2>&1'

IPv6 support

The default records use IPv4 only. Use these records if you need IPv6 support.

Copy
# IPv6 only $ q foo.v6.daho.im foo.v6.daho.im. 1h0m0s AAAA ::1 # IPv4 and IPv6 $ q foo.v4v6.daho.im foo.v4v6.daho.im. 1h0m0s AAAA ::1 foo.v4v6.daho.im. 1h0m0s A 127.0.0.1

FRITZ!Box issues

Check Wildcard hostnames for development (daho.im, vcap.me) do not resolve with FRITZ!Box as DNS resolver if your FRITZ!Box does not resolve this domain.

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for unsupported versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2).

Owner of this card:

Avatar
Henning Koch
Last edit:
about 13 hours ago
by Andreas Vöst
Keywords:
vcap.me, lvh.me, lacolhost.com, localtest.me
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more