7 "github.com/pion/datachannel"
8 "github.com/pion/webrtc/v2"
10 "github.com/anacrolix/torrent/webtorrent"
13 const webrtcNetwork = "webrtc"
15 type webrtcNetConn struct {
16 datachannel.ReadWriteCloser
17 webtorrent.DataChannelContext
20 type webrtcNetAddr struct {
21 webrtc.SessionDescription
24 func (webrtcNetAddr) Network() string {
28 func (me webrtcNetAddr) String() string {
29 // TODO: What can I show here that's more like other protocols?
33 func (me webrtcNetConn) LocalAddr() net.Addr {
34 return webrtcNetAddr{me.Local}
37 func (me webrtcNetConn) RemoteAddr() net.Addr {
38 return webrtcNetAddr{me.Remote}
41 func (w webrtcNetConn) SetDeadline(t time.Time) error {
45 func (w webrtcNetConn) SetReadDeadline(t time.Time) error {
49 func (w webrtcNetConn) SetWriteDeadline(t time.Time) error {