A more accurate concept of the inequality you are looking is a Sobolev-type inequality or more precisely Hardy's inequality. The proof of this inequality can be found in most books on weighted Sobolev inequality, say the excellent book by V. G. Maz'ya. If you just want a directly proof, say for instance the following paper
"Kinnunen, Juha; Martio, Olli, Hardy's inequalities for Sobolev functions. (English summary) Math. Res. Lett. 4 (1997), no. 4, 489–500. "
I would like to talk more about this inequality from the point view of capacity or equivalently non-linear potential. The standard proof of all (fractional) Sobolev-type inequality based on point-wise characterization of Sobolev functions, which basically reads as for a.e. $x,y$ $$|u(x)-u(y)|\leq c(n)|x-y|^{1-\alpha/p}(M_{\alpha/p}|Du|(x)+M_{\alpha/p}|Du|(y)),$$ where $M_\beta$ is the standard fractional maximal operator. In order to gain global estimates, one just integrate the above inequality and use the boundedness of the maximal operator. The equivalence of characterizations of Sobolev function can be found in the nice book of J.Heinonen, "Lectures on Analysis on Metric Spaces, Springer Verlag, Universitext 2001." or the forthcoming book of J.Heinonen et al. "Sobolev spaces on metric measure spaces, an approach based on upper gradients."
Hardy-type inequalities are usually regarded as weighted Sobolev type inequality by considering the potential term $|y-z|^{k}$ or $d(y,\partial \Omega)^k$ as a general weight. I encourage you to read the nice paper by
P.Koskela, P.Hajlasz, Isoperimetric inequalities and imbedding theorems in irregular domains. J. London Math. Soc. (2) 58 (1998), no. 2, 425–450
and
P.Koskela, P.Hajlasz, Sobolev met Poincaré. Mem. Amer. Math. Soc. 145 (2000), no. 688, x+101 pp.
The basic capacity view is to regard the right-hand side as certain capacity, and characterize the Sobolev/Hardy type inequality in terms of certain capacity. Then one could use the standard techniques from potential theory to do capacity estimates. This point of view is quite important in proving Sobolev/Hardy type inequality for irregular domains or in metric setting. As a sample, you could also read the following paper.
Koskela, Pekka; Lehrbäck, Juha, Weighted pointwise Hardy inequalities. (English summary) J. Lond. Math. Soc. (2) 79 (2009), no. 3, 757–779.
See also the homepage of J.Luhrback for the recent progress on Hardy type inequality for general domains: http://users.jyu.fi/~juhaleh/publ.html.
If you want a global inequality with a uniform constant, then you have to impose (non-negative) lower bounded on the Ricci curvature (in metric measure spaces as well). In the smooth compact Riemannian setting, the constant is of course uniform.