4 ms·
Smack a Ho.st - A localhost domain
- anotherjesse 17y agoI also wildcard *.localhacks.com to 127.0.0.1
- volomike 17y agoMy /etc/hosts has: 127.0.0.1 me So I can do http://me/website-to-test/ http://me/website-to-test/
- jrockway 17y agoBut if you are developing a site that uses the subdomain as a routing rule, that fails. Your /etc/hosts entry won't make http://fuck.me/ http://fuck.me/ go to your site, which is what smackaho.st will allow you to do. Obviously this is easy enough to fake without DNS trickery; just modify the outgoing "Host:" header or teach your proxy how to "resolve" names in the form of "*.me".
- bruceboughton 17y agoPlease don't - .me is a popular TLD.
- jrockway 17y agoIt's the parent's example, not mine.
- fizx 17y agoThe nice thing about this, for all of you people who understandably don't get it, is that setting up wildcard dns on OS X is a royal PITA. You can't just modify /etc/hosts, you have to http://www.macosxhints.com/article.php?story=2005110220352084 http://www.macosxhints.com/article.php?story=200511022035208... Given all rails developers use a Mac ;) this is useful.
- MartinMond 17y agoHm, I modify my /etc/hosts all the time and it works as it should.
- slig 17y agoI works, but not as simple for using domain wildcards, as he mentioned.
- Erwin 17y agoDo you need subdomains specificially, or just different addresses that resolve to localhost? If so you could use e.g http://127.1:3000/ http://127.1:3000/, http://127.2:3000/ http://127.2:3000/ etc. (or the full 127.0.0.1 127.0.0.2 if your browser doesn't like 127.1).
- samdk 17y agoOne of the (Rails) apps I'm developing needs subdomains, and I don't think it's uncommon. We probably could find some way to develop without subdomains, but Rails likes doing it this way. While aliasing localhost takes about 30 seconds (on Linux, at least), this trick will make it a little easier for new contributers to get involved.
- 100k 17y agoHaving subdomains is nice when you're developing an app that will use sudomains for accounts in production.
- mootothemax 17y agoFor getting up and running you don't necessarily need them, but it can make life easier e.g. name-based virtual hosts.
- ugg 17y agoLaboratory Evaluation, http://www.shoesgroups.com/reebokanswer-c-70.html http://www.shoesgroups.com/reebokanswer-c-70.html, pump technology can support the players affect the soles of the feet and legs friction weight, these <a href="http://www.shoesgroups.com/reebokanswer-c-70.html>wholesale http://www.shoesgroups.com/reebokanswer-c-70.html>wholes... reebok answer shoes</a> are the perfect combination of speed and passion. This wholesale reebok answer shoe has launched an all-star red, black and the world, these two limited edition colors. Series, as fans should not miss the fine, We are free shippmtand a week to your door.004
- olefoo 17y agoWhy is this specific to Rails? The beauty of the web and of the internet protocols it's built on is that you can have multiple implementations that respond to the same interface. DNS doesn't care what language it's pointing to.
- danparsonson 17y agoIt's not specific to Rails, only his example URL is - Rails listens on port 3000 by default. You could equally try http://iwishyouwouldnt.smackaho.st:80/ http://iwishyouwouldnt.smackaho.st:80/ and get your local web server.
- blasdel 17y agoThere's already a totally unambiguous domain for this -- why not alias *.localhost?
- generalk 17y agoIf you're developing on Rack-based webapps on MacOS, check out http://github.com/alloy/passengerpane http://github.com/alloy/passengerpane -- it's a System Preferences panel to automatically sets up local DNS and Apache/Phusion Passenger vhosts for projects. If there's a similar tool for non-MacOS or non-Rack stuff I'd love to hear about it.
- mikexstudios 17y ago*.somesite.com has been around since 2003 and points to 127.0.0.1.