简体   繁体   中英

get html from webpage using IPv6 address and javascript

I was wondering if there was a way to use JavaScript to get a httpGet request from a IPv6 address.

I've set up a virtual mesh network using cooja on my home computer, each node has an IPv6 address in the form of aaaa::0212:740x:000x:0x0x where x is the node number.

When using a normal jquery request:

$.ajax({ url: url,
 success: function(data) 
 {console.log(data); } 
});

a website eg http://www.random.org/intergers/?etc , will get a random number back and log it, however when a ipv6 address is put in ie [aaaa::0212:740x:000x:0x0x] it doesnt give me back anything, no errors, no response, nothing.

Can anybody shed some light on this issue?

The correct syntax for a URL containing an IPv6 address is:

http://[2607:f8b0:4005:802::1010]/

The brackets are necessary to distinguish address components from a port number.

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