tangled
alpha
login
or
join now
l4.pm
/
jetstream-proxy
3
fork
atom
auto-reconnecting jetstream proxy
3
fork
atom
overview
issues
pulls
pipelines
support non-tls upstreams
l4.pm
4 months ago
ba937f02
983c6d93
+4
-2
1 changed file
expand all
collapse all
unified
split
main.go
+4
-2
main.go
···
75
}
76
77
func measureLatency(url string) (time.Duration, error) {
78
-
httpsURL := strings.Replace(url, "wss://", "https://", 1)
0
0
79
80
client := &http.Client{
81
Timeout: 20 * time.Second,
82
}
83
84
start := time.Now()
85
-
resp, err := client.Get(httpsURL)
86
if err != nil {
87
return 0, err
88
}
···
75
}
76
77
func measureLatency(url string) (time.Duration, error) {
78
+
url = strings.Replace(url, "wss://", "https://", 1)
79
+
// also support non-tls upstreams
80
+
url = strings.Replace(url, "ws://", "http://", 1)
81
82
client := &http.Client{
83
Timeout: 20 * time.Second,
84
}
85
86
start := time.Now()
87
+
resp, err := client.Get(url)
88
if err != nil {
89
return 0, err
90
}