URL with Address+Port

  1. As mentioned in RFC 5952 Section 6, when you want to specify the port number in a URL, you may type it as "[2001:db8::1]:80".
  2. The following three URLs will show the same webpage, because Apache listens on port 80 by default.
    1. http://pearl.csie.ncnu.edu.tw/
    2. http://163.22.22.66/
    3. http://[2001:e10:6840:22:240:f4ff:fee9:14ae]/
    4. http://pearl.csie.ncnu.edu.tw:80/
    5. http://163.22.22.66:80/
    6. http://[2001:e10:6840:22:240:f4ff:fee9:14ae]:80/
  3. You may visit a webpage on another port:
    1. http://pearl.csie.ncnu.edu.tw:8006/
    2. http://[2001:e10:6840:22:240:f4ff:fee9:14ae]:8006/
  4. If you inspect the packets in Wireshark, they look similar. Please look at the fields of IP addresses and port numbers. Although the URL representation in a browser looks different, they packets they send to the WWW server are the same.
  5. PS: I run my Flask script by However, this makes it listen to IPv6 only.
    On the contrary, if I run It listens to IPv4 only.
  6. Bonus: Can you find a way to make my Flask program listen to both IPv4/IPv6?