IPv6 have colon character, for example FF:00::EE
If concatenate URL String, IPv6 URL will like:
 http://FF:00::EE:8888/a/b/c
Actually we want:
 http://[FF:00::EE]:8888/a/b/c
Simply concatenate URL will cause error.

Take above line for example.

If not use square bracket, can’t identify “8888” is port or part of IPv6 address.
Please use the following code to create new URI
  new URI("http", null,<host>, <port>, <additional URL>, null, null)

How to support both ipv4 and ipv6 address for JAVA code.的更多相关文章

  1. golang 判断IPv4 or IPv6 address

    import strings func IsIPv4(address string) bool { return strings.Count(address, ":") < ...

  2. ipv4与ipv6 Inet4Address类和Inet6Address类

    在设置本地IP地址的时候,一些人会疑惑IPv4与IPv6的区别是什么?下面由学习啦小编为你分享ipv4与ipv6的区别的相关内容,希望对大家有所帮助. ipv4与ipv6的区别 在windows 7以 ...

  3. ipv4、ipv6的socket同时监听“bind: Address already in use”的解决方法

    创建ipv4和ipv6的socket,同时监听某个端口的ipv4和ipv6报文,运行时bind函数执行失败,提示“bind: Address already in use”.原因:ipv6的socke ...

  4. RFC2474 - Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers的双语版

    RFC2474 - Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers英文版 ...

  5. Convert IPv6 Address to IP numbers (C#)

    URL: http://lite.ip2location.com/ Use the code below to convert the IP address of your web visitors ...

  6. IPv6 tutorial 4 IPv6 address syntax

    https://4sysops.com/archives/ipv6-tutorial-part-4-ipv6-address-syntax/ Now that you know about the n ...

  7. IPv6下网络编程socket, TCP和UDP例子,以及兼容IPV4和IPV6的类

    一.TCP socket ipv6与ipv4的区别 服务器端源代码如下: #include <stdio.h> #include <stdlib.h> #include < ...

  8. IPv4到IPv6的三种过渡技术

    1. 双协议栈 ( Dual Stack, RFC2893 ) 主机同时运行IPv4和IPv6两套协议栈,同时支持两套协议. 2. 隧道技术 ( Tunnel, RFC2893 ) 这种机制用来在IP ...

  9. windows 获取本机(全部)IPv4、IPv6、MAC地址方法 (C/C++)

    windows下获取IP地址的两种方法: 一种可以获取IPv4和IPv6,但是需要WSAStartup: 一种只能取到IPv4,但是不需要WSAStartup: 如下: 方法一:(可以获取IPv4和I ...

随机推荐

  1. [poj] 1235 Farm Tour || 最小费用最大流

    原题 费用流板子题. 费用流与最大流的区别就是把bfs改为spfa,dfs时把按deep搜索改成按最短路搜索即可 #include<cstdio> #include<queue> ...

  2. POJ3717 Decrypt the Dragon Scroll

    Description Those who have see the film of "Kong Fu Panda" must be impressive when Po open ...

  3. WebRTC 视频对话

    今天聊一下WebRTC.很多开发者,可能会觉得有些陌生,或者直接感觉繁杂.因为WebRTC在iOS上的应用,只是编译都让人很是头痛.这些话,到此为止,以防让了解者失去信心.我们只传播正能量,再多的困难 ...

  4. Linux命令(IT)

    ls  查看当前目录下文件 cd 指定目录 sftp zygf@xxx.xxx.xxx.xxx  进行登录zygf用户 sftp命令行登录过程: ① sftp   xxx.xxx.xxx.xxx   ...

  5. gdb 记录临时变量

    gdb ./pgm set logging file log set logging on ... set logging off gdb ./pgm | tee -a log ... file a. ...

  6. 搭建github服务器

    https://about.gitlab.com/downloads/#centos6

  7. 华为上机测试题(求亮灯数量-java)

    PS:自己写的,自测试OK,供大家参考. /* 一条长廊里依次装有n(1 ≤ n ≤ 65535)盏电灯,从头到尾编号1.2.3.…n-1.n.每盏电灯由一个拉线开关控制.开始,电灯全部关着.有n个学 ...

  8. python 独立环境安装

    python 即使是单独编译安装的,库文件的安装还是会与其它python的库存放到相同的地方 使用同版本库不会有问题,但是需要升级库的时候,就会出现冲突,导致依赖这个旧库的python出现问题 这时候 ...

  9. VBA 学习

    Sub abc() Dim i Dim coloumn coloumn = For i = To Dim currentValue currentValue = Val(ReplaceChar(She ...

  10. 获取a'p'p签名

    1.第一种方式 https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list& ...