Why is xip io needed when I can access the IP directly?

China☆狼群 提交于 2019-12-04 15:59:02

问题


xip.io welcome screens says this :

10.0.0.1.xip.io resolves to 10.0.0.1

Why do we need to go through xip io when I can directly use the IP?

Is it used to access servers by domain name instead of IP?


回答1:


The main use case is when your application needs to support multiple subdomains.

Take for example these production subdomains:

  • www.example.com
  • admin.example.com
  • members.example.com

Or you can consider a multi-tenant application where each account gets its own custom subdomain:

  • mycompany.example.com
  • anotherguy.example.com

So it's easy enough to setup a production environment to serve this requests.

But without a service like xip.io for your development environment, you cannot put a subdomain in front of an IP address to route your request appropriately.

To get around this, you can access your application through a subdomain like this through xip.io:

http://mycompany.10.0.0.1.xip.io/

As xip.io states, this then works flawlessly if you're trying to access the application from other machines on your local network, be they smartphones, tablets, other OSes within VMs, etc.



来源:https://stackoverflow.com/questions/37150895/why-is-xip-io-needed-when-i-can-access-the-ip-directly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!