mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add Snowflake Event Reporter for Peer Communication
This commit is contained in:
parent
c3f09994da
commit
9a7fcdec03
1 changed files with 4 additions and 0 deletions
|
@ -191,6 +191,7 @@ func (c *WebRTCPeer) preparePeerConnection(config *webrtc.Configuration) error {
|
|||
return err
|
||||
}
|
||||
dc.OnOpen(func() {
|
||||
c.eventsLogger.OnNewSnowflakeEvent(&event.EventOnSnowflakeConnected{})
|
||||
log.Println("WebRTC: DataChannel.OnOpen")
|
||||
close(c.open)
|
||||
})
|
||||
|
@ -198,6 +199,9 @@ func (c *WebRTCPeer) preparePeerConnection(config *webrtc.Configuration) error {
|
|||
log.Println("WebRTC: DataChannel.OnClose")
|
||||
c.Close()
|
||||
})
|
||||
dc.OnError(func(err error) {
|
||||
c.eventsLogger.OnNewSnowflakeEvent(&event.EventOnSnowflakeConnectionFailed{Error: err})
|
||||
})
|
||||
dc.OnMessage(func(msg webrtc.DataChannelMessage) {
|
||||
if len(msg.Data) <= 0 {
|
||||
log.Println("0 length message---")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue