Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingPort = errors.New("missing port")
Functions ¶
func DetectTLS ¶ added in v0.6.1
DetectTLS attempts to detect TLS on a connection by sending a ClientHello and checking for early TLS fingerprints without performing a full handshake.
It returns true if TLS is detected, false otherwise.
The function uses the following steps: 1. Generate a random 32-byte value for the ClientHello. 2. Create a ServerNameIndication (SNI) extension for the hostname. 3. Create a ClientHello message with the random value and the SNI extension. 4. Send the ClientHello message to the server. 5. Read the response from the server. 6. Check if the response contains a ServerHello or tls alert message. 7. If the response contains a ServerHello or tls alert message, return true. 8. Otherwise, return false.
func TryJoinHostPort ¶
TryJoinHostPort joins host and port. If port is empty, it returns host and an error.
Types ¶
This section is empty.