Recently I read a book about linear algebraic group written by Ian Macdonald. There is a conclusion which I can't prove. It says that if X is locally compact Hausdorff space, then X is compact if and only if, for all locally compact sapces Y, the projection X$\times$Y $\to$ Y is a closed map. Is it a fact for all topology spaces? Thank you in advance