1
0
mirror of https://github.com/fumiama/terasu.git synced 2026-06-12 06:00:37 +08:00

feat: add http3 & optimize conn

This commit is contained in:
源文雨
2025-10-27 22:47:46 +08:00
parent b66c0ae3cf
commit 1d07d1e19e
8 changed files with 246 additions and 18 deletions

28
http2/http_test.go Normal file
View File

@@ -0,0 +1,28 @@
package http2
import (
"io"
"testing"
)
func TestClientGet(t *testing.T) {
resp, err := Get("https://huggingface.co/")
if err != nil {
t.Fatal(err)
}
defer resp.Body.Close()
t.Log("[T] response code", resp.StatusCode)
for k, vs := range resp.Header {
for _, v := range vs {
t.Log("[T] response header", k+":", v)
}
}
data, err := io.ReadAll(resp.Body)
if err != nil {
t.Fatal(err)
}
if len(data) == 0 {
t.Fail()
}
t.Log(string(data))
}