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
tls.Conn can be rewound by using reflect to modify its internal buffer.
func RewindTlsConn(conn *tls.Conn, read []byte) { var ( tlsInput, _ = reflect.TypeOf(tls.Conn{}).FieldByName("input") input = (*bytes.Reader)(unsafe.Add(unsafe.Pointer(conn), tlsInput.Offset)) remaining = input.Len() size = int(input.Size()) buffered = len(read) ) if buffered <= size { _, _ = input.Seek(0, 0) } else { buf := make([]byte, buffered+remaining) copy(buf, read) _, _ = input.Read(buf[buffered:]) input.Reset(buf) } }
There is no need to turn on allow h2c if caddy is using https.
The text was updated successfully, but these errors were encountered:
Hi, I'm not familiar with reflect. Can you create a PR?
reflect
Sorry, something went wrong.
No branches or pull requests
tls.Conn can be rewound by using reflect to modify its internal buffer.
There is no need to turn on allow h2c if caddy is using https.
The text was updated successfully, but these errors were encountered: