重定向到127.0.0.1
-- 相当于 localhost。
这是我的 /etc/hosts 文件:
root@vagrant:~# cat /etc/hosts
127.0.0.1 localhost stuff.dev
127.0.1.1 vagrant.vm vagrant
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
我有一个在端口 8000 上运行的烧瓶应用程序,我现在可以通过 stuff.dev:8000 访问它
root@vagrant:~# wget stuff.dev:8000
--2013-09-13 02:22:14-- http://stuff.dev:8000/
Resolving stuff.dev (stuff.dev)... 127.0.0.1
Connecting to stuff.dev (stuff.dev)|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2 [text/html]
Saving to: ‘index.html’
100%[================================================================================================================================================================>] 2 --.-K/s in 0s
2013-09-13 02:22:14 (229 KB/s) - ‘index.html’ saved [2/2]