ysbaddaden / prax.cr

Rack proxy server for development (Crystal port)
Other
152 stars 18 forks source link

Use ".test" TLD rather than Google-owned ".dev" TLD. #68

Closed jacksonrayhamilton closed 6 years ago

jacksonrayhamilton commented 6 years ago

Fixes https://github.com/ysbaddaden/prax.cr/issues/61. Pow decided to use ".test" so I figured we would do the same.

Of course, this will be a breaking change, but a welcome one.

ysbaddaden commented 6 years ago

This is out-of-sync with master.

I guess it's an acceptable solution. Prax doesn't care about the actual TLD anyway; it already accepts .test, .localhost or .whatever.you.want as long as they resolve to a local IP, so that just changes the default configured TLD.

I'll keep using .dev myself and damn Google.

jacksonrayhamilton commented 6 years ago

Synchronized with master.

I suppose we can change the TLD by setting PRAX_DOMAINS? Maybe that should be documented, I see it in the code but not mentioned anywhere.

ysbaddaden commented 6 years ago

Nope, the way we resolve hosts doesn't involve PRAX_DOMAINS anymore. Given myapp.some.where.localhost, for example, Prax will search, in order, for:

  1. myapp.some.where.localhost
  2. myapp.some.where
  3. myapp.some
  4. myapp

The TLD isn't of any importance; as long as a domain resolves to localhost, Prax will gladly accept it.

ysbaddaden commented 6 years ago

I didn't verify my claim, maybe it's skips the right-most TLD by default and thus searches for myapp.some.where initially. What's important is that the right-most TLDs can be whatever.

jacksonrayhamilton commented 6 years ago

What's the best way to make the domains resolve to localhost? Update /etc/dnsmasq.d/prax manually and change "test" to one's TLD of choice?

ysbaddaden commented 6 years ago

Yes, for example. I copy-pasted test and localhost files myself, and left prax as is.

jacksonrayhamilton commented 6 years ago

I added documentation explaining how to use Prax with other TLDs.

Is this good to merge?

ysbaddaden commented 6 years ago

Yup, thank you!