Use event logger for proxy starting message and NAT info

This commit is contained in:
itchyonion 2022-11-07 15:20:20 -08:00
parent 2f55581098
commit 768b80dbdf
No known key found for this signature in database
GPG key ID: 4B87B720348500EA
3 changed files with 21 additions and 2 deletions

View file

@ -58,6 +58,14 @@ func (e EventOnSnowflakeConnectionFailed) String() string {
return fmt.Sprintf("trying a new proxy: %s", scrubbed)
}
type EventOnProxyStarting struct {
SnowflakeEvent
}
func (e EventOnProxyStarting) String() string {
return "Proxy starting"
}
type EventOnProxyConnectionOver struct {
SnowflakeEvent
InboundTraffic int
@ -68,6 +76,15 @@ func (e EventOnProxyConnectionOver) String() string {
return fmt.Sprintf("Proxy connection closed (↑ %d, ↓ %d)", e.InboundTraffic, e.OutboundTraffic)
}
type EventOnCurrentNATTypeDetermined struct {
SnowflakeEvent
CurNATType string
}
func (e EventOnCurrentNATTypeDetermined) String() string {
return fmt.Sprintf("NAT type: %v", e.CurNATType)
}
type SnowflakeEventReceiver interface {
// OnNewSnowflakeEvent notify receiver about a new event
// This method MUST not block