I took another look at Cloud Pipe since it was updated over the holidays. It looks like a fine way to solve the NAT problem for some realtime clients.
I have an alternate suggestion about namespace handling. A Cloud Pipe ping looks like this on the wire:
<?xml version="1.0"?> <packets> <fatPing feed="http://www.nytimes.com/services/xml/rss/userland/HomePage.xml"> <![CDATA[<title>Florida's Meyer Will Take Leave, Not Resign</title> <link>http://www.nytimes.com/2009/12/28/sports/ncaafootball/28florida.html?partner=rss&amp;emc=rss</link> <guid isPermaLink="true">http://www.nytimes.com/2009/12/28/sports/ncaafootball/28florida.html</guid> <description>Florida Coach Urban Meyer told his team he would not step down but would take an indefinite leave of absence.</description> <dc:creator>By PETE THAMEL</dc:creator> <pubDate>Sun, 27 Dec 2009 19:42:18 GMT</pubDate> <category domain="http://www.nytimes.com/namespaces/keywords/des">College Athletics</category> <category domain="http://www.nytimes.com/namespaces/keywords/nyt_org_all">University of Florida</category> <category domain="http://www.nytimes.com/namespaces/keywords/nyt_per">Meyer, Urban</category> <category domain="http://www.nytimes.com/namespaces/keywords/nyt_per">Thamel, Pete</category> ]]> </fatPing> <system> <serialnum>28440</serialnum> <when>Sun, 27 Dec 2009 20:23:13 GMT</when> <secs>58.43333333</secs> </system> </packets>The client then decodes the CDATA section to recover the original RSS <item>:
<title>Florida's Meyer Will Take Leave, Not Resign</title> <link>http://www.nytimes.com/2009/12/28/sports/ncaafootball/28florida.html?partner=rss&emc=rss</link> <guid isPermaLink="true">http://www.nytimes.com/2009/12/28/sports/ncaafootball/28florida.html</guid> <description>Florida Coach Urban Meyer told his team he would not step down but would take an indefinite leave of absence.</description> <dc:creator>By PETE THAMEL</dc:creator> <pubDate>Sun, 27 Dec 2009 19:42:18 GMT</pubDate> <category domain="http://www.nytimes.com/namespaces/keywords/des">College Athletics</category> <category domain="http://www.nytimes.com/namespaces/keywords/nyt_org_all">University of Florida</category> <category domain="http://www.nytimes.com/namespaces/keywords/nyt_per">Meyer, Urban</category> <category domain="http://www.nytimes.com/namespaces/keywords/nyt_per">Thamel, Pete</category>Unfortunately the dc namespace hasn’t been declared anywhere so we don’t know what it means. Looking at the original feed, we see namespace declarations on the root element:
<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0" version="2.0">
<channel>
<title>NYT > Home Page</title>
...
When extracting a single <item> from the feed, we can preserve the namespace declarations by “pushing them down” onto each <item> like so: (In this case I have taken a somewhat brute force approach of copying all the namespace declarations, even though most of them aren’t needed.)
<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0" version="2.0">
<channel>
<title>NYT > Home Page</title>
...
<item xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0">
<title>Tensions Mount in Devastated Capital as Nations Step Up Aid Pledges to Haiti</title>
<link>http://www.nytimes.com/2010/01/15/world/americas/15haiti.html?partner=rss&emc=rss</link>
<guid isPermaLink="true">http://www.nytimes.com/2010/01/15/world/americas/15haiti.html</guid>
<description>Signs of tension and urgency were growing in the devastated capital as the police and government had all but vanished.</description>
<dc:creator>By MARC LACEY</dc:creator>
<pubDate>Fri, 15 Jan 2010 05:28:37 GMT</pubDate>
...
</item>
...
Now the item stands alone and can be embedded into a Cloud Pipe without any encoding:
<?xml version="1.0"?> <packets> <fatPing feed="http://www.nytimes.com/services/xml/rss/userland/HomePage.xml"> <item xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0"> <title>Tensions Mount in Devastated Capital as Nations Step Up Aid Pledges to Haiti</title> <link>http://www.nytimes.com/2010/01/15/world/americas/15haiti.html?partner=rss&emc=rss</link> <guid isPermaLink="true">http://www.nytimes.com/2010/01/15/world/americas/15haiti.html</guid> <description>Signs of tension and urgency were growing in the devastated capital as the police and government had all but vanished.</description> <dc:creator>By MARC LACEY</dc:creator> <pubDate>Fri, 15 Jan 2010 05:28:37 GMT</pubDate> ... </item> </fatPing> <system> <serialnum>28440</serialnum> <when>Sun, 27 Dec 2009 20:23:13 GMT</when> <secs>58.43333333</secs> </system> </packets>XML experts, please let me know if I’ve gotten anything wrong here.