What is IPV6 for localhost and 0.0.0.0?

前端 未结 5 786
花落未央
花落未央 2020-11-30 23:12

As we all know the IPv4 address for localhost is 127.0.0.1 (loopback address). What is the IPv6 address for localhost and for 0.

5条回答
  •  春和景丽
    2020-12-01 00:03

    IPv6 localhost

    ::1 is the loopback address in IPv6.

    Within URLs

    Within a URL, use square brackets []:

    • http://[::1]/
      Defaults to port 80.
    • http://[::1]:80/
      Specify port.

    Enclosing the IPv6 literal in square brackets for use in a URL is defined in RFC 2732 – Format for Literal IPv6 Addresses in URL's.

提交回复
热议问题