Read more

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

Henning Koch
February 15, 2018Software engineer at makandra GmbH

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

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

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:

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:

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):

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

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

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.

# 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.

Posted by Henning Koch to makandra dev (2018-02-15 14:33)