-
Notifications
You must be signed in to change notification settings - Fork 46
/
stuninput.go
44 lines (40 loc) · 1.12 KB
/
stuninput.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Package stuninput contains stun targets as well as
// code to format such targets according to various conventions.
package stuninput
import (
"fmt"
"net/url"
)
// TODO(bassosimone): we need to keep this list in sync with
// the list internally used by TPO's snowflake.
var inputs = []string{
"stun.voip.blackberry.com:3478",
"stun.altar.com.pl:3478",
"stun.antisip.com:3478",
"stun.bluesip.net:3478",
"stun.dus.net:3478",
"stun.epygi.com:3478",
"stun.sonetel.com:3478",
"stun.sonetel.net:3478",
"stun.stunprotocol.org:3478",
"stun.uls.co.za:3478",
"stun.voipgate.com:3478",
"stun.voys.nl:3478",
}
// AsSnowflakeInput formats the input in the format
// that is expected by snowflake.
func AsSnowflakeInput() (output []string) {
for _, input := range inputs {
output = append(output, fmt.Sprintf("stun:%s", input))
}
return
}
// AsnStunReachabilityInput formats the input in
// the format that is expected by stunreachability.
func AsnStunReachabilityInput() (output []string) {
for _, input := range inputs {
serio := (&url.URL{Scheme: "stun", Host: input})
output = append(output, serio.String())
}
return
}