Let $G$ be a (maybe Lie) group, and $M$ a space (perhaps a manifold). Then a principal $G$-bundle over $M$ is a bundle $P \to M$ on which $G$ acts (by fiber-preserving maps), so that each fiber is a $G$-torsor (a $G$-action isomorphic, although not canonically so, to the action of $G$ on itself by multiplication). A map of $G$-bundles is a bundle map that plays well with the actions.


Then I more-or-less know what the *classifying space* of $G$ is: it's some bundle $EG \to BG$ that's universal in the homotopy category of (principal) $G$-bundles. I.e. any $G$-bundle $P \to M$ has a (unique up to homotopy) map $P\to EG$ and $M \to BG$, and conversely any map $M\to BG$ (up to homotopy) determines a (unique up to isomorphism) bundle $P \to M$ and by pulling back the obvious square.


At least this is how I think it works. [Wikipedia's description of $BG$ is here.](http://en.wikipedia.org/wiki/Classifying_space)


So, let $G$ be a Lie group and $M$ a smooth manifold. On a $G$-bundle $P \to M$ I can think about *connections*. As always, a connection should determine for each smooth path in $M$ a $G$-torsor isomorphism between the fibers over the ends of the path. So in particular, a bundle-with-connection is a (smooth) functor from the path space of $M$ to the category of $G$-torsors. But not all of these are connections: the value of holonomy along a path is an invariant up to "thin homotopy", which is essentailly homotopy that does not push away from the image of the curve. So one could say that a bundle-with-connection is a smooth functor from the thin-homotopy-path-space.


More hands-on, a connection on $P \to G$ is a ${\rm Lie}(G)$-valued one-form on $P$ that is (1) invariant under the $G$ action, and (2) restricts on each fiber to the canonical ${\rm Lie}(G)$-valued one-form on $G$ that takes a tangent vector to its left-invariant field (thought of as an element of ${\rm Lie}(G)$).


Anyway, my question is: is there a "space" (of some sort) that classifies $G$-bundles over $M$ with connections? By which I mean, the data of such a bundle should be the same (up to ...) as a map $M \to $ this space. The category of $G$-torsors is almost right, but then the map comes not from $M$ but from its thin-homotopy path space.


Please re-tag as desired.



What is the classifying space of "G-bundles with connections"
There is a stupid answer which is equivalence classes of G-bundles with connection on M are the same as homotopy classes of maps $M \to BG$. That is as long as two G-bundles with connection are considered equivalent if they have the same underlying principal bundle. This isn't meant to be a serious answer, just point out that your question is not exactly well posed. 


But more seriously, there is a stack which represents G-principal bundles with connections. It even has a nice form:


$$ Bun\_G^\nabla = [ \Omega^1( - ; \mathfrak{g}) / G]$$ 


Maps from M to this stack **are** principal G-bundles with connection. 


The problem with this stack is that it is not *presentable*. It is not covered by a manifold. It can be describe as a quotient stack, but thing you act on is the sheaf $\Omega^1(-; \mathfrak{g})$ of Lie algebra valued 1-forms. This is a sort of generalized manifold (in a loose sense), but this sheaf is not representable (great exercise!). 


If it was a presentable stack, then we could take its classifying space (there are several ways to do this, e.g take the realization of the simplicial manifold obtained by iterated fiber products of the covering manifold). Homotopy classes of maps to this space could then be related to certain isomorphism classes of maps to the stack. But since $Bun^\nabla\_G$ is not presentable we are kinda stuck. 


You could ask, well what happens if I replace $\Omega^1(-; \mathfrak{g})$ with an honest topological space that is the best approximation to it (for maps into it). Well it turns out the space which best approximates $\Omega^1(-; \mathfrak{g})$ is the point. So you get the classifying space of the stack $[pt/G]$ which is just the usual BG.


