简体   繁体   中英

How do I use a Java or Scala http client with a link-local ipv6 address?

What is the best Java or Scala client for issuing link-local http requests? Also, what's an example of how to use the client with link-local addresses (this is fairly complicated and error prone for unix utilities such as curl, which often don't even work with link-local addresses at all due to the requirement of including the interface in the address). I'm looking for a solution that works on Ubuntu Linux.

All Java HTTP client libraries make use of Java's lower level network address and socket libraries. These "just work" with IPv6 ... assuming that your operating system and network have IPv6 networking configured properly.

UPDATE - Java supports IPv6 "zone identifiers" aka "scoped addresses" in Java 6 onwards. Refer to the javadocs here for the details.

So, basically, you should be able to use a Java HTTP client library with IPv6 link-local addresses the same way you use it with other kinds of addresses.

Additional reference:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM