nazar-pc/webtorrent-dht

Issue with node-webrtc does not seem to be resolved in 0.8.2

Closed this issue · 9 comments

0.8.2 supposedly should have fixed: node-webrtc/node-webrtc#281.
Originally I built wrtc myself as suggested in the quoted issue and things started just fine with an initial connection from the node to the bs server.
When I update from 0.8.0 to 0.8.1 and do not replace the wrtc.node file with the self-built one, the error from the quoted issue pops up. It vanishes after the update to 0.8.2. But then I do not get any connections.
The server debug for example prints: 'peer connected: undefined:NaN'
When I replace the wrtc.node file with my self-built one everything goes back to the state it has been before, as far as I can see this far.

I do not know if this is an issue with node-webrtc itself or just some changes that have to be made within webtorrent-dht as an consequence of the update within the dependency.

There was no meaningful code changes between 0.8.0 and 0.8.2 as you can see: 0.8.0...0.8.2
And after quick test 0.8.2 worked for me.

So if the issue is not yet fixed for you (I mean it prints the same error as in linked issue) it must be an upstream issue then.

What Node.js version do you have by the way? I'm on 9.2.0.

Also peer connected: undefined:NaN seems strange, since it indicates that corresponding remoteAddress and remotePort properties were not correctly assigned within simple-peer itself:

peer_connection = @_simple_peer_constructor(Object.assign({}, @_simple_peer_opts, {initiator}))
..on('connect', !~>
debug('peer connected: %s:%d', peer_connection.remoteAddress, peer_connection.remotePort)

Removed node_modules and executed npm install and for some reason got the same issue as you O_o. Investigating now.

Looks like it is an incompatibility between simple-peer and newer version of wrtc. Didn't expect this at all.

Ok. Good to know that its not just me.
I am using 6.11.4 atm since I am working with another project that needs this version. Will update if this gets resolved and I can update without rebuilding wrtc :D.

I'll try to debug simple-peer to fix this issue, not sure how much time it'll take though as it is not that small and I'm not familiar with internals.

Ok. The selfbuilding workaround still seems to work so I will just continue with this.
Thanks for the help and quick response!

This should be resolved once feross/simple-peer#215 is merged.
Can you confirm the fix?

Published 0.8.3 that uses my fork for now, this should be fixed now.

Yeah. Things seem to work now. Perfect, thank you very much for the quick reaction and fix!