Introducing NetGrouper for Easy Real-time RTMFP P2P Connections Between SWFs

Andrew Walpole
{{Nested Loops}}
Published in
2 min readFeb 27, 2013

I built this library a while ago, but am just getting it out there. A few years ago Adobe introduced RTMFP (the Real-Time Media Flow Protocol). Essentially this protocol lets you connect client swfs directly with each other over UDP P2P connections. Even more simply put, it means you can share data back and forth in near real-time. RTMFP connections can be made over the internet, but you have to go through Adobe Cirrus which has been on Adobe Labs since it debuted. To use the service you have to get a free developer key, and as long as you’re not abusing it or making money with it you’re cool to take advantage of it.

However, the piece that is lesser known about RTMFP connections is that you can use them over a local network without the dependency on Cirrus. I wrote NetGrouper to make it easy to allow your Flash projects use RTMFP connections, both locally or with Cirrus. I won’t get into the code here, but check out the example on GitHub, the good bits are pretty well documented.

A few things worth noting about it:

  • It works best with apps intended to have less than 14 concurrent users, above that, it has to switch how it sends messages and gets significantly slower.
  • I haven’t been able to build a reliable way to keep track of all connected users, especially when you get above 20 or so concurrent connections.
  • Some internet connections behind double firewalls will cause your connections to fail.

Lastly, here are two side-by-side swf instances of it in action connecting over Adobe Cirrus (you’ll have to allow Flash Player to make p2p connections):

[kml_flashembed publishmethod=”static” fversion=”10.2.0" movie=”/resources/NetGrouperExample.swf” width=”225" height=”200" targetclass=”flashmovie”]

Get Adobe Flash player

[/kml_flashembed]

[kml_flashembed publishmethod=”static” fversion=”10.2.0" movie=”/resources/NetGrouperExample.swf” width=”225" height=”200" targetclass=”flashmovie”]

Get Adobe Flash player

[/kml_flashembed]

If you don’t see anything in the swfs above, you may be behind a network that is not allowing your connection to the Cirrus server.

NetGrouper on GitHub

--

--

Andrew Walpole
{{Nested Loops}}

Developer, Designer, Teacher, Learner, Innovation Dabbler