|
|
@@ -58,6 +58,8 @@ const (
|
|
58
|
58
|
|
|
59
|
59
|
OptionTypeAntiReplayMaxSize
|
|
60
|
60
|
|
|
|
61
|
+ OptionTypeMultiplexPerConnection
|
|
|
62
|
+
|
|
61
|
63
|
OptionTypeSecret
|
|
62
|
64
|
OptionTypeAdtag
|
|
63
|
65
|
)
|
|
|
@@ -80,6 +82,8 @@ type Config struct {
|
|
80
|
82
|
|
|
81
|
83
|
AntiReplayMaxSize int64 `json:"anti_replay_max_size"`
|
|
82
|
84
|
|
|
|
85
|
+ MultiplexPerConnection int `json:"multiplex_per_connection"`
|
|
|
86
|
+
|
|
83
|
87
|
Debug bool `json:"debug"`
|
|
84
|
88
|
Verbose bool `json:"verbose"`
|
|
85
|
89
|
StatsdTagsFormat statsd.TagFormat `json:"statsd_tags_format"`
|
|
|
@@ -149,6 +153,8 @@ func Init(options ...Opt) error { // nolint: gocyclo, funlen
|
|
149
|
153
|
C.CloakPort = int(opt.Value.(uint16))
|
|
150
|
154
|
case OptionTypeAntiReplayMaxSize:
|
|
151
|
155
|
C.AntiReplayMaxSize = int64(opt.Value.(units.Base2Bytes))
|
|
|
156
|
+ case OptionTypeMultiplexPerConnection:
|
|
|
157
|
+ C.MultiplexPerConnection = int(opt.Value.(uint))
|
|
152
|
158
|
case OptionTypeSecret:
|
|
153
|
159
|
C.Secret = opt.Value.([]byte)
|
|
154
|
160
|
case OptionTypeAdtag:
|
|
|
@@ -173,6 +179,10 @@ func Init(options ...Opt) error { // nolint: gocyclo, funlen
|
|
173
|
179
|
return errors.New("incorrect secret")
|
|
174
|
180
|
}
|
|
175
|
181
|
|
|
|
182
|
+ if C.MultiplexPerConnection == 0 {
|
|
|
183
|
+ return errors.New("cannot use 0 clients per connection for multiplexing")
|
|
|
184
|
+ }
|
|
|
185
|
+
|
|
176
|
186
|
if C.CloakHost != "" {
|
|
177
|
187
|
addrs, err := net.LookupHost(C.CloakHost)
|
|
178
|
188
|
if err != nil {
|