If $X$ is a set (regarded as a discrete space), its Stone-Čech compactification can be identified with the set of ultrafilters on $X$ with its natural (Stone) topology. If $X$ is a general topological space, given any continuous function $f : X \to C$ from $X$ to a compact Hausdorff space $C$, we can push forward ultrafilters on $X$ to ultrafilters on $C$, which must have unique limits. So define an equivalence relation on ultrafilters as follows: $F \sim F'$ if their pushforwards under all continuous functions from $X$ to some compact Hausdorff space $C$ have the same limits. Then it seems to me that the set of equivalence classes of ultrafilters on $X$ under $\sim$, with an appropriate topology (perhaps the quotient topology from the space of ultrafilters on $X$?), ought to be the Stone-Čech compactification of $X$ in general.

So does this construction actually work, and if so, is there a simpler definition of the equivalence relation $\sim$? 

**Edit:** also, if this construction works, is it explicitly written down anywhere in the literature? The references I found seem to work with a different notion of ultrafilter (ultrafilters of zero sets or something like that), and I'm wondering whether (or why) this is necessary.

**Edit #2:** Okay, so as it stands, the problem that I see with the definition of $\sim$ is that I am attempting to quantify over the class of compact Hausdorff spaces. How do I fix this?