Get html from webpage using IPv6 address and javascript

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

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

When using a regular jquery query:

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

a website, for example http://www.random.org/intergers/?etc , will receive a random number and register it, however, when the ipv6 address is put, i.e. [aaaa :: 0212: 740x: 000x: 0x0x] it returns nothing to me, no errors, no answer, nothing.

Can anyone shed some light on this issue?

+6
source share
1 answer

The correct syntax for the URL containing the IPv6 address is:

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

Brackets are needed to distinguish address components from port numbers.

+1
source

Source: https://habr.com/ru/post/957420/


All Articles