mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
feat(proxy): add failed connection count stats
For the summary log and for Prometheus metrics. Log output example: > In the last 1h0m0s, there were 7 completed successful connections. 2 connections failed. Traffic Relayed ↓ 321 KB (0.10 KB/s), ↑ 123 KB (0.05 KB/s).
This commit is contained in:
parent
5ef4761968
commit
583178f4f2
5 changed files with 53 additions and 13 deletions
|
@ -682,6 +682,9 @@ func (sf *SnowflakeProxy) runSession(sid string) {
|
|||
connectedToClient = true
|
||||
case <-time.After(dataChannelTimeout):
|
||||
log.Println("Timed out waiting for client to open data channel.")
|
||||
sf.EventDispatcher.OnNewSnowflakeEvent(
|
||||
event.EventOnProxyConnectionFailed{},
|
||||
)
|
||||
if err := pc.Close(); err != nil {
|
||||
log.Printf("error calling pc.Close: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue