node-datachannel icon indicating copy to clipboard operation
node-datachannel copied to clipboard

feat: support setting ICE ufrag and pwd, disabling fingerprint validation and specifying certificates

Open achingbrain opened this issue 1 year ago • 2 comments

https://github.com/paullouisageneau/libjuice/pull/243 allows setting the ICE ufrag and pwd fields instead of generating random ones every time.

https://github.com/paullouisageneau/libdatachannel/pull/1207 adds an init arg to setLocalDescription to allow setting the fields in libjuice from libdatachannel.

https://github.com/paullouisageneau/libdatachannel/pull/1206 allows reading the fingerprint of the cert being used by the remote peer.

This PR adds the init arg to setLocalDescription, and the remoteFingerprint method, plus the missing config keys.

This is required to implement libp2p WebRTC-Direct.

It will require the PRs above being merged and shipped before this is ready so I've opened it as a draft for now.

Refs: https://github.com/paullouisageneau/libdatachannel/issues/1166

achingbrain avatar Jun 06 '24 15:06 achingbrain

Thanks for the PR. It would be good if you also add these changes here;

  • https://github.com/murat-dogan/node-datachannel/blob/a862c23ca1f690ff83c592586e612b7189928c56/lib/index.d.ts#L280
  • https://github.com/murat-dogan/node-datachannel/blob/master/API.md

murat-dogan avatar Jun 09 '24 13:06 murat-dogan

Hello, Thanks for the work!

When that could be ready for merging?

murat-dogan avatar Jun 22 '24 18:06 murat-dogan

@murat-dogan @achingbrain what remains before we can merge?

unicomp21 avatar Nov 18 '24 12:11 unicomp21

For the functionality to be usable this PR needs to be merged/released as well - https://github.com/paullouisageneau/libjuice/pull/248 - then this one: https://github.com/paullouisageneau/libdatachannel/pull/1211 - then we can expose it here.

achingbrain avatar Nov 18 '24 12:11 achingbrain

given the delay, would it make sense to consider forking in the meantime?

unicomp21 avatar Nov 18 '24 12:11 unicomp21

disabling fingerprint validation

if ^ was a separate PR, do we have anything blocking us on the libdatachannel side? My reason for asking, I'm using a homegrown turn: server w/ local short circuit, and don't need the other parts, afaik.

unicomp21 avatar Nov 18 '24 13:11 unicomp21

https://github.com/murat-dogan/node-datachannel/pull/308

unicomp21 avatar Nov 18 '24 14:11 unicomp21

given the delay, would it make sense to consider forking in the meantime?

@paullouisageneau what do you think, will you have some time to let us merge the final couple of outstanding PRs (https://github.com/paullouisageneau/libjuice/pull/248 and https://github.com/paullouisageneau/libdatachannel/pull/1211) or should we do our own thing?

achingbrain avatar Nov 18 '24 14:11 achingbrain

Hi all,

I think forking the lib is not feasible. Let’s ping @paullouisageneau to see if there’s a problem to be solved for PRs @achingbrain mentioned.

To merge only fingerprint feature is something @achingbrain should decide, while he worked on this PR already. If this will be the case also this PR must be re-worked.

murat-dogan avatar Nov 19 '24 16:11 murat-dogan

I'll do another pass on https://github.com/paullouisageneau/libjuice/pull/248

This issue was closed but as I understand it is still blocking, as the ICE ufrag and pwd can't be applied from the polyfill: https://github.com/paullouisageneau/libdatachannel/issues/1218

paullouisageneau avatar Nov 19 '24 18:11 paullouisageneau

Is there something that I can do @paullouisageneau ?

murat-dogan avatar Nov 20 '24 19:11 murat-dogan

I've merged https://github.com/paullouisageneau/libjuice/pull/248, next steps are merging https://github.com/paullouisageneau/libjuice/pull/248 and fixing the polyfill.

paullouisageneau avatar Jan 09 '25 14:01 paullouisageneau

I've updated this branch and fixed the merge conflicts, though I still need to expose the unhandled stun request callback - I'm just testing this locally and will push an update here.

I've also updated https://github.com/paullouisageneau/libdatachannel/pull/1211 to use the API landed in https://github.com/paullouisageneau/libjuice/pull/248 though it's still waiting for a libjuice release. Optionally https://github.com/paullouisageneau/libjuice/pull/291 exposes a the slightly more explicit API - it could be merged and https://github.com/paullouisageneau/libdatachannel/pull/1211 updated again or closed - it's up to @paullouisageneau.

achingbrain avatar Jan 14 '25 16:01 achingbrain

The unhandled STUN callback is in now but it needs:

  • [x] https://github.com/paullouisageneau/libjuice/pull/292
  • [ ] https://github.com/paullouisageneau/libdatachannel/pull/1211

achingbrain avatar Jan 16 '25 18:01 achingbrain

Just checking in here.

I'm still waiting for @paullouisageneau to do a libjuice release that includes https://github.com/paullouisageneau/libjuice/pull/292 which can then be rolled up to https://github.com/paullouisageneau/libdatachannel/pull/1211

achingbrain avatar Mar 21 '25 12:03 achingbrain

@achingbrain Done, I've released libjuice v1.6.0 with https://github.com/paullouisageneau/libjuice/pull/292

paullouisageneau avatar Mar 25 '25 10:03 paullouisageneau

@paullouisageneau awesome, thanks! I've updated libdatachannel#1211 to use the new v1.6.0 release.

achingbrain avatar Mar 25 '25 10:03 achingbrain

Checking in again.

Currently waiting for @paullouisageneau to do a libdatachannel release that includes https://github.com/paullouisageneau/libdatachannel/pull/1211 - then this PR will be ready to go.

achingbrain avatar Apr 10 '25 10:04 achingbrain

@murat-dogan since you've switched to the HEAD of libdatachannel this PR should be ready now.

achingbrain avatar Jun 10 '25 16:06 achingbrain

I've released libdatachannel v0.23.0 with the changes. Thank you for your patience.

paullouisageneau avatar Jun 11 '25 12:06 paullouisageneau

Super. Thank you.

murat-dogan avatar Jun 12 '25 17:06 murat-dogan