This commit is contained in:
parent
b9f02ddbea
commit
248d076f47
1 changed files with 8 additions and 1 deletions
9
main.go
9
main.go
|
@ -25,6 +25,7 @@ import (
|
||||||
"github.com/prometheus/procfs"
|
"github.com/prometheus/procfs"
|
||||||
"github.com/quic-go/quic-go"
|
"github.com/quic-go/quic-go"
|
||||||
"github.com/quic-go/quic-go/http3"
|
"github.com/quic-go/quic-go/http3"
|
||||||
|
"golang.org/x/net/http2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -75,6 +76,12 @@ var h2client = &http.Client{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var h2client_test = &http.Client{
|
||||||
|
// Yeah I know I can just use http.Transport and it will use HTTP/2 automatically
|
||||||
|
// I prefer to set it up explicitly
|
||||||
|
Transport: &http2.Transport{},
|
||||||
|
}
|
||||||
|
|
||||||
var client *http.Client
|
var client *http.Client
|
||||||
|
|
||||||
var default_ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
|
var default_ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
|
||||||
|
@ -505,7 +512,7 @@ func main() {
|
||||||
if h3c {
|
if h3c {
|
||||||
client = h3client
|
client = h3client
|
||||||
} else {
|
} else {
|
||||||
client = h2client
|
client = h2client_test
|
||||||
}
|
}
|
||||||
|
|
||||||
if https {
|
if https {
|
||||||
|
|
Loading…
Add table
Reference in a new issue