libp2p / go-libp2p-webrtc-direct

A libp2p transport that enables browser-to-server, and server-to-server, direct communication over WebRTC without requiring signalling servers
MIT License
82 stars 18 forks source link

Failed to run when trying out the standalone example #50

Closed JimBeam2019 closed 2 years ago

JimBeam2019 commented 2 years ago

Hi there,

I was trying out the exact code in examples/standalone in my PC(Ubuntu), and it failed when run (go run . -listen). The error messages showed below.

# github.com/libp2p/go-libp2p-webrtc-direct
/home/root/go/pkg/mod/github.com/libp2p/go-libp2p-webrtc-direct@v0.0.0-20220114121551-711dccc4656f/conn.go:269:29: not enough arguments in call to muxer.NewConn
        have (net.Conn, bool)
        want (net.Conn, bool, network.PeerScope)
/home/root/go/pkg/mod/github.com/libp2p/go-libp2p-webrtc-direct@v0.0.0-20220114121551-711dccc4656f/listener.go:140:2: cannot use conn (type *Conn) as type transport.CapableConn in return argument:
        *Conn does not implement transport.CapableConn (missing Scope method)
/home/root/go/pkg/mod/github.com/libp2p/go-libp2p-webrtc-direct@v0.0.0-20220114121551-711dccc4656f/transport.go:63:2: cannot use conn (type *Conn) as type transport.CapableConn in return argument:
        *Conn does not implement transport.CapableConn (missing Scope method)
/home/root/go/pkg/mod/github.com/libp2p/go-libp2p-webrtc-direct@v0.0.0-20220114121551-711dccc4656f/webrtcdirect.go:16:5: cannot use &Conn{} (type *Conn) as type transport.CapableConn in assignment:
        *Conn does not implement transport.CapableConn (missing Scope method)

Could anyone have a look at it and give me a hint where I did it wrong, please? Thank you.

marten-seemann commented 2 years ago

Looks like you're running with a different set of dependencies. Please make sure to run with 1. an up to date Go version and 2. with the set of dependencies from go.mod.