Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

WIP: Add support for new Protocol and Multiaddr format #26

Open
wants to merge 1 commit into
base: webrtc-signal-protocol
Choose a base branch
from

Conversation

albrow
Copy link
Contributor

@albrow albrow commented Apr 2, 2019

This is a stepping stone toward implementing the generic WebRTC Signal Protocol described in libp2p/specs#159.

This PR doesn't change the behavior of the transport. It still only supports browser-server and server-server connections and doesn't use any third-parties for signaling. Rather, this PR lays the groundwork for implementing new features in the future.

@albrow albrow requested a review from backkem April 2, 2019 22:13
@@ -55,7 +55,7 @@ github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324 h1:PV190X5/DzQ/tbFFG5Y
github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag=
github.com/ipfs/go-cid v0.0.1 h1:GBjWPktLnNyX0JiQCNFpUuUSoMw5KMyqrsejHYlILBE=
github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
github.com/ipfs/go-datastore v0.0.1/go.mod h1:bYmHO9fuKO1Ca7dpdDBWQl0mndy5b0HFqSJjGlNYtzs=
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was seeing some errors about a checksum mismatch. Manually changing this line fixed them.

Copy link
Contributor

@backkem backkem Apr 2, 2019

Choose a reason for hiding this comment

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

I guess this can be fixed (dependency removed entirely) by dropping the examples.

var _ transport.Transport = &Transport{}

// Fmt is the Multiaddress format for WebRTC
var Fmt = mafmt.And(mafmt.HTTP, mafmt.Base(Protocol.Code))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, we're only supporting signaling over HTTP. In the future it should be possible to support many different transports. Hopefully we can rely on existing code in libp2p to set up a connection (likely a Stream) using an arbitrary transport.

@@ -9,7 +9,6 @@ import (

var log = logging.Logger("webrtcdirect-tpt")

var webrtcma, _ = ma.NewMultiaddr("/p2p-webrtc-direct")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the new Multiaddress format requires a peer id after p2p-webrtc, we can't create it statically anymore.

@albrow albrow added the status/WIP This a Work In Progress label Apr 2, 2019
@albrow albrow changed the title Add support for new Protocol and Multiaddr format WIP: Add support for new Protocol and Multiaddr format Apr 2, 2019
@albrow albrow changed the base branch from master to webrtc-signal-protocol April 2, 2019 22:29
Copy link
Contributor

@backkem backkem left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/WIP This a Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants