do not crash if clientHello is nil

This commit is contained in:
mmmray
2024-04-29 18:46:12 -04:00
committed by yuhan6665
parent eed01aa642
commit de7a8e5061
+1 -1
View File
@@ -208,7 +208,7 @@ func Server(ctx context.Context, conn net.Conn, config *Config) (*Conn, error) {
}
mutex.Unlock()
if hs.c.conn != conn {
if config.Show {
if config.Show && hs.clientHello != nil {
fmt.Printf("REALITY remoteAddr: %v\tforwarded SNI: %v\n", remoteAddr, hs.clientHello.serverName)
}
io.Copy(target, underlying)