nodejs http request immediately after adding a new address result in EADDRNOTAVAIL
<pre><code>//nodejs code

var ip=&lt;some_ip_address&gt;;
//for me it is 2001:250:401:3611:50c6:6b18:e8f7:f882

exec('powershell new-netipaddress '+ip+' -InterfaceAlias WLAN',(e,so,se)=&gt;{
    http.request({
        host:'2404:6800:4005:805::200e',//just use google as an example
        family:6,
        localAddress:ip
    },(res)=&gt;{
        console.log('reachable');
    }).on('error',(e)=&gt;{
        console.log(e);
    })
}).stdin.end();
</code></pre>

<p>then output</p>

<pre><code>{[Error: bind EADDRNOTAVAIL 2001:250:401:3611:50c6:6b18:e8f7:f882]
code: 'EADDRNOTAVAIL',
errno: 'EADDRNOTAVAIL',
syscall: 'bind',
address: '2001:250:401:3611:50c6:6b18:e8f7:f882' }
</code></pre>

<p>the 2nd time 
(actually I am testing address , since our DHCP-stateless is broken)</p>

<pre><code>{ [Error: connect ETIMEDOUT 2404:6800:4005:805::200e:80]
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '2404:6800:4005:805::200e',
port: 80 }
</code></pre>

<p>me can draw from the 2nd time output,</p>

<p>new-netipaddress did add the address properly, so the callback runs well(although timeout, which we designed it to be)</p>

<p>but in 1st time the callback failed with EADDRNOTAVAIL</p>

<p>so why it failed with the first run? and how to avoid it?</p>