Add snowflake event handler to client config

This commit is contained in:
Shelikhoo 2021-11-29 12:46:51 +00:00
parent b5ef18803f
commit cd6d837d85
No known key found for this signature in database
GPG key ID: C4D5E79D22B25316

View file

@ -35,6 +35,7 @@ import (
"strings" "strings"
"time" "time"
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/nat" "git.torproject.org/pluggable-transports/snowflake.git/v2/common/nat"
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/turbotunnel" "git.torproject.org/pluggable-transports/snowflake.git/v2/common/turbotunnel"
"github.com/pion/webrtc/v3" "github.com/pion/webrtc/v3"
@ -92,6 +93,9 @@ type ClientConfig struct {
// Max is the maximum number of snowflake proxy peers that the client should attempt to // Max is the maximum number of snowflake proxy peers that the client should attempt to
// connect to. Defaults to 1. // connect to. Defaults to 1.
Max int Max int
// EventDispatcher is the event bus for snowflake events.
// When an important event happens, it will be distributed here.
EventDispatcher event.SnowflakeEventDispatcher
} }
// NewSnowflakeClient creates a new Snowflake transport client that can spawn multiple // NewSnowflakeClient creates a new Snowflake transport client that can spawn multiple