Refactor creation of webRTCConn in proxy

This commit is contained in:
Cecylia Bocovich 2022-10-18 14:55:50 -04:00
parent 90d1a56719
commit 6007d5e08e
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90
2 changed files with 7 additions and 2 deletions

View file

@ -384,8 +384,7 @@ func (sf *SnowflakeProxy) makePeerConnectionFromOffer(sdp *webrtc.SessionDescrip
close(dataChan)
pr, pw := io.Pipe()
conn := &webRTCConn{pc: pc, dc: dc, pr: pr, eventLogger: sf.EventDispatcher}
conn.bytesLogger = newBytesSyncLogger()
conn := newWebRTCConn(pc, dc, pr, sf.EventDispatcher)
dc.OnOpen(func() {
log.Println("OnOpen channel")