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
75
}
76
76
77
77
func measureLatency(url string) (time.Duration, error) {
78
78
-
httpsURL := strings.Replace(url, "wss://", "https://", 1)
78
78
+
url = strings.Replace(url, "wss://", "https://", 1)
79
79
+
// also support non-tls upstreams
80
80
+
url = strings.Replace(url, "ws://", "http://", 1)
79
81
80
82
client := &http.Client{
81
83
Timeout: 20 * time.Second,
82
84
}
83
85
84
86
start := time.Now()
85
85
-
resp, err := client.Get(httpsURL)
87
87
+
resp, err := client.Get(url)
86
88
if err != nil {
87
89
return 0, err
88
90
}