Roughly the same way. You write a proxy that either tracks or queries the management api for exchanges declared on any of the RabbitMQ nodes and use that information to route your publishes.
There are a bunch of non-trivial problems such as making your proxy highly available, avoiding race conditions and some strategy for routing to exchanges with the same name but on different nodes but it all depends on what you want from your system.
Another option would be to develop an erlang plugin that pushes the exchanges to the proxies when they change.
Cheers
Karl