mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add proxy event logger state propagate
This commit is contained in:
parent
e4305a4d2b
commit
f12cfe6a9f
1 changed files with 5 additions and 1 deletions
|
@ -115,6 +115,7 @@ type SnowflakeProxy struct {
|
|||
NATProbeURL string
|
||||
// NATTypeMeasurementInterval is time before NAT type is retested
|
||||
NATTypeMeasurementInterval time.Duration
|
||||
EventDispatcher event.SnowflakeEventDispatcher
|
||||
shutdown chan struct{}
|
||||
}
|
||||
|
||||
|
@ -340,7 +341,7 @@ func (sf *SnowflakeProxy) makePeerConnectionFromOffer(sdp *webrtc.SessionDescrip
|
|||
close(dataChan)
|
||||
|
||||
pr, pw := io.Pipe()
|
||||
conn := &webRTCConn{pc: pc, dc: dc, pr: pr}
|
||||
conn := &webRTCConn{pc: pc, dc: dc, pr: pr, eventLogger: sf.EventDispatcher}
|
||||
conn.bytesLogger = newBytesSyncLogger()
|
||||
|
||||
dc.OnOpen(func() {
|
||||
|
@ -524,6 +525,9 @@ func (sf *SnowflakeProxy) Start() error {
|
|||
if sf.NATProbeURL == "" {
|
||||
sf.NATProbeURL = DefaultNATProbeURL
|
||||
}
|
||||
if sf.EventDispatcher == nil {
|
||||
sf.EventDispatcher = event.NewSnowflakeEventDispatcher()
|
||||
}
|
||||
|
||||
broker, err = newSignalingServer(sf.BrokerURL, sf.KeepLocalAddresses)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue