mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
client,proxy: add a media channel
This commit is contained in:
parent
70974640ab
commit
0a7291e90f
3 changed files with 70 additions and 0 deletions
|
@ -451,6 +451,19 @@ func (sf *SnowflakeProxy) makePeerConnectionFromOffer(
|
|||
return nil, fmt.Errorf("accept: NewPeerConnection: %s", err)
|
||||
}
|
||||
|
||||
pc.OnTrack(func(remote *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) {
|
||||
log.Printf("Track has started streamId(%s) id(%s) rid(%s) \n", remote.StreamID(), remote.ID(), remote.RID())
|
||||
|
||||
for {
|
||||
rtcpBuf := make([]byte, 1500)
|
||||
for {
|
||||
if _, _, err := receiver.Read(rtcpBuf); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
pc.OnDataChannel(func(dc *webrtc.DataChannel) {
|
||||
log.Printf("New Data Channel %s-%d\n", dc.Label(), dc.ID())
|
||||
close(dataChan)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue