방금 nodejs에이 간단한 프로그램을 만들었지 만 NIC의 ipv6 주소에 바인드 할 수 없습니다. 네트워크 연결 바인딩 로컬 인터페이스 : 로컬 ipv6 주소를 node.js 프로그램에 어떻게 바인드합니까?
본인은 API 문서에 다음보이나 인근을 참조하십시오.
var http = require('http');
var options = {
hostname: 'www.whatismyipv6.com',
localAddress: '2a01:xxxx:xxxx:xxxx::2' //a real ipv6 address here
};
var req = http.request(options, function(res) {
res.on('data', function (chunk) {
console.log(chunk.toString());
});
});
req.on('error', function(e) {
console.log('ERROR: ' + e.message);
});
req.end();
그러나 내가 프로그램을 실행할 때 이것을 얻습니다. ipv4 주소를 기록하십시오.
<head>
<title>WhatIsMyIPv6? (IPv4: xx.xx.xxx.xxx)</title>
<meta name="bitly-verification" content="984886d337a6"/>
</head>
nodejs가 localAddress를 무시하고 ipv4 주소에 직접 바인딩되어있는 것 같습니다.
# node --version
v0.8.0