We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I am currently facing an issue with sending a GET request to https://http2.pro/api/v1.
GET
https://http2.pro/api/v1
The steps to reproduce:
git clone https://github.com/mehtaabGill/utls-test.git
cd utls-test
go get
go run main.go
The error i am receiving:
panic: Get "https://http2.pro/api/v1": net/http: HTTP/1.x transport connection broken: malformed HTTP status code "bad" goroutine 1 [running]: main.main() C:/Users/mehta/go/src/github.com/mehtaabGill/utls-test/main.go:23 +0x4f3 exit status 2
What I expected to see: A proper JSON response which indicates I sent a request with a connection that supports HTTP2
Note - I am using the HelloChrome_83 ClientHelloID
HelloChrome_83
The text was updated successfully, but these errors were encountered:
func CreateHTTPClient() http.Client { // initialize the http client client := http.Client{ Transport: &http2.Transport{ // this "tls.Config" comes from "crypto/tls" DialTLS: func(network, addr string, cfg *otls.Config) (net.Conn, error) { //initialize the tcp connection tcpConn, err := (&net.Dialer{}).Dial(network, addr) if err != nil { return nil, err } //initialize the conifg for tls config := tls.Config{ ServerName: strings.Split(addr, ":")[0], //set the server name with the provided addr } //initialize a tls connection with the underlying tcop connection and config tlsConn := tls.UClient(tcpConn, &config, tls.HelloChrome_83) //start the tls handshake between servers err = tlsConn.Handshake() if err != nil { return nil, fmt.Errorf("uTlsConn.Handshake() error: %w", err) } return tlsConn, nil }, }, } return client }
If you could confirm that server has h2 support, try to use http2.Transport in client
Sorry, something went wrong.
No branches or pull requests
Hello,
I am currently facing an issue with sending a
GET
request tohttps://http2.pro/api/v1
.The steps to reproduce:
git clone https://github.com/mehtaabGill/utls-test.git
cd utls-test
go get
go run main.go
The error i am receiving:
What I expected to see:
A proper JSON response which indicates I sent a request with a connection that supports HTTP2
Note - I am using the
HelloChrome_83
ClientHelloIDThe text was updated successfully, but these errors were encountered: