This commit is contained in:
gospider
2025-02-05 13:24:22 +08:00
parent 79cec56aec
commit 50a8c48a30
2 changed files with 28 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"context"
"crypto/tls"
"log"
"testing"
@@ -123,3 +124,29 @@ func TestHttp3Proxy(t *testing.T) {
// client()
client2()
}
func TestHttp3Proxy2(t *testing.T) {
go proxyServer(proxyHost)
for range 5 {
resp, err := requests.Get(context.TODO(), "https://cloudflare-quic.com/", requests.RequestOption{
ClientOption: requests.ClientOption{
H3: true,
// Logger: func(l requests.Log) {
// log.Print(l)
// },
Proxys: []string{
// "http://" + proxyHost,
"socks5://" + proxyHost,
},
},
Body: []byte("hello, server!"),
})
if err != nil {
fmt.Println(err)
continue
}
fmt.Println(resp.StatusCode())
fmt.Println(resp.Proto())
time.Sleep(time.Second)
}
}