mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Add EventOnProxyConnectionOver Reporting
This commit is contained in:
parent
d64af31394
commit
e4305a4d2b
2 changed files with 8 additions and 0 deletions
|
@ -40,6 +40,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/messages"
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/task"
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/util"
|
||||
|
@ -350,6 +351,11 @@ func (sf *SnowflakeProxy) makePeerConnectionFromOffer(sdp *webrtc.SessionDescrip
|
|||
defer conn.lock.Unlock()
|
||||
log.Println("OnClose channel")
|
||||
log.Println(conn.bytesLogger.ThroughputSummary())
|
||||
in, out := conn.bytesLogger.GetStat()
|
||||
conn.eventLogger.OnNewSnowflakeEvent(event.EventOnProxyConnectionOver{
|
||||
InboundTraffic: in,
|
||||
OutboundTraffic: out,
|
||||
})
|
||||
conn.dc = nil
|
||||
dc.Close()
|
||||
pw.Close()
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
|
||||
"github.com/pion/ice/v2"
|
||||
"github.com/pion/sdp/v3"
|
||||
"github.com/pion/webrtc/v3"
|
||||
|
@ -30,6 +31,7 @@ type webRTCConn struct {
|
|||
once sync.Once // Synchronization for PeerConnection destruction
|
||||
|
||||
bytesLogger bytesLogger
|
||||
eventLogger event.SnowflakeEventReceiver
|
||||
}
|
||||
|
||||
func (c *webRTCConn) Read(b []byte) (int, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue