Client B throw Error: listen EADDRINUSE
So, i think my setup is okay, yet, clientB crash
Error: listen EADDRINUSE 172.19.21.58:34662
ClientA is like
R:\node-tcp-hole-punching>node clientA.js
> (A->S) connecting to S
> (A->S) connected to S via 192.168.131.19 65066
> (A->S) response from S: {"name":"A","localAddress":"192.168.131.19","localPort":65066,"remoteAddress":"::ffff[something],"remotePort":65066}
> (A) 192.168.131.19:65066 ===> (NAT of A) ::ffff:[something]65066 ===> (S) [somethingelse]:9999
> (A->S) response from S: {"name":"B","localAddress":"172.19.21.58","localPort":34662,"remoteAddress":"::ffff:[BPublicIP]","remotePort":34662}
> (A) time to listen on port used to connect to S (65066)
> (A->B) connecting to B: ===> (B) ::ffff:[BPublicIP]:34662
> (A) listening on 192.168.131.19:65066
> (A->B) connection closed with err: ETIMEDOUT
> (A->B) connecting to B: ===> (B) ::ffff:[BPublicIP]:34662
clientB is like
> (B->S) response from S: {"name":"A","localAddress":"192.168.131.19","localPort":65066,"remoteAddress":"::ffff:[clientAPublic]","remotePort":65066}
> (B) time to listen on port used to connect to S (34662)
> (B->A) connecting to A: ===> (A) ::ffff:[clientAPublic]:65066
events.js:141
throw er; // Unhandled 'error' event
Is there something i can try ?
Are you an mac or on windows? (or linux)?
Client A is windows, client B linux (both with node 4.5)
The same error with me ClientA is on Windows, ClientB is on Linux
If ClientA is behind NAT, ClientB has public IP, this will affect the result?
I don't think its possible to listen on the same port in Windows.
2016-12-13 17:55 GMT+01:00 birbird [email protected]:
The same error with me ClientA is on Windows, ClientB is on Linux
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SamDecrock/node-tcp-hole-punching/issues/2#issuecomment-266794610, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhmVw67S2wJza_uynRSJEMusNaTUgQWks5rHs3qgaJpZM4K7I2k .
same problem to me. I'm run it on OS X Yosemite
If one client has a public IP,it's not going to work. Both clients need to be behind different NATs, Sam mentions this in his How-To
Just repeating my input on issue #4:
I tested different variations and this is what I got:
clientA<->NATA<->PublicServer<->NATB<->clientB : everything ok clientA<->NATA<->PublicServer<->clientB (no NATB): clientB throws EADDRINUSE. Obviously you get the same reaction when you swap clientA and clientB.
Looking through the code, it would be very easy to extend the client code so it handles fine if client is not behind a NAT, it's actually just ignoring/not running some current code.
I'd close this issue, as far as I can see the SW works as described (unless I missed something ;-)