Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Upgradable MultiaddrConnection#29

Merged
ckousik merged 4 commits intodevelopfrom
ckousik/upgradable
Oct 12, 2022
Merged

Upgradable MultiaddrConnection#29
ckousik merged 4 commits intodevelopfrom
ckousik/upgradable

Conversation

@ckousik
Copy link
Copy Markdown
Collaborator

@ckousik ckousik commented Sep 28, 2022

We use the new Upgrader interface to use in-built encryption and multiplexing of a WebRTC connection.

Comment thread src/sdp.ts Outdated
const log = logger('libp2p:webrtc:sdp');

const mbdecoder = (function () {
export const mbdecoder = (function () {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why's this exported?

Comment thread src/stream.ts
private readonly channel: RTCDataChannel;

source: Source<Uint8ArrayList> = pushable();
_src: Source<Uint8ArrayList> = pushable();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I misremember "source" being part of the interface or has the interface changed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we just use a getter/setter pattern for accessing source.

Comment thread src/stream.ts
this.readClosed = true;
this.writeClosed = true;
this.channel.close();
if (this.closeCb) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to think for a second about what cb might stand for. Perhaps the name could be more verbose.

Comment thread src/options.ts

export interface WebRTCDialOptions extends DialOptions {
}
export interface WebRTCDialOptions extends DialOptions {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be something here specifying your upgrader as the default one?

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants