5 Replies Latest reply on Dec 6, 2010 8:27 AM by doognukem

    Need Help Setting Up a Web Service!

    phaseblue Level 1

      I am using the Adobe sample to test/learn how to set up p2p connections. 

      I have downloaded the source code, inserted my "Developer ID", compiled

      it, and uploaded it to my web host.  The problem is that whenever I try to

      connect, I keep getting a Error# 2032!  I started reading more of the help

      documentation and found out that I need to set up a web service:


      "When you build your own Video Phone sample, you must run your own

      web service and specify WebServiceUrl in VideoPhoneLabs.mxml. You

      should override the AbstractIdManager class to implement your own

      peer ID exchange mechanism—using, for example, XMPP, Google Apps,

      or the Facebook framework."


      I have absolutely no clue what a WebServiceUrl is, or why I even need one! 

      It seems to me that the connection to the Cirrus server ("rtmfp://p2p.rtmfp.net")

      should be enough to connect the two peer IDs / streams together.  I thought

      that`s what it was for!


      I`m an experienced Actionscript developer, but I am pretty much a noob

      when it comes to working with live p2p audio/video streaming.  Can anyone

      give me some advice on this?


      I appreciate any help anyone can give!



        • 1. Re: Need Help Setting Up a Web Service!

          There are 2 main ways of using RTMFP P2P.


          1. Connect to Cirrus Rendevous server and generate a peerID which you then have to share with other peers who want to connect.

          • You can share by hosting a web service that both clients connect to, to negotiate the peerID,
          • OR simpler you could just expose the peerID as a link then  you can open a new window (or IM/Email to another user) then in your flash client you can parse the query string for that peer ID (e.g. http://localhost:8888/p2pTest.html?peerID=436234623462346...)



          2. The latest RTMFP implementation allows you to use Groups which you can connect to the same GroupSpecifier (basically a unique name + connection parameters), this would allow you to connect without a webservice.


          I suggest looking at some of the newer Group tutorials (they're easier to just get up and running, eventually you're going to want to build a webservice because users all can't conceivably connect to the same group for most applications).

          1 person found this helpful
          • 2. Re: Need Help Setting Up a Web Service!
            phaseblue Level 1



            Thank you so much for your help!  I did some background reading about web services,

            so I`m starting to understand what they`re used for.  I will look into the RTMFP Groups

            you mentioned, however as you suggested, I eventually want to build a web service.  I

            read that Google XMPP is good for creating web services, but I`m not sure how to go

            about doing this.  I imagine since the Adobe p2p video streaming sample code has

            been made available for download, and this sort of application is becoming popular, that

            someone has already written a web service that works with it.  Do you know if there is

            any publicly available web service code out there?  Is writing a web service difficult?


            Again, sorry for my ignorance in this area, but I`m still getting up to speed with it all!



            • 3. Re: Need Help Setting Up a Web Service!
              doognukem Level 1

              If you're looking to setup a public webservice the best option out there right now is Google Appengine (it's free up to a certain point, which is perfect for testing and small beta, and then you just pay for what you use if you get bigger). You can build a simple webservice in Python/Java that you can then connect with in your flash client (XML/JSON/AMF using open source Adobe BlazeDS).


              I plan on releasing a source code and a demo of setting up RTMFP peerID rendevous through a Java webservice on google appengine, and then extending that to allow users to create "rooms" which would essentially be unique RTMFP Groups that  users could join.

              • 4. Re: Need Help Setting Up a Web Service!
                phaseblue Level 1



                Thank you again for all your help!  Like anything else, this topic can get pretty deep,

                and the more I understand, the more questions I  have.  However, I think my planned

                use for this technology is fairly simple.


                Here`s what I want to do:

                I want to set up a p2p video chat application (exactly like the Adobe sample) where the

                user can make VoIP calls to another user just like Skype.  There is no multicasting,

                just a 1-to-1 connection between two people.  Also, many people might be setting up

                p2p connections from my server at the same time.  All I need is a reliable web service

                for my use case.  There is a Python .cgi script that comes with the Adobe sample.  Is

                this the web service?  Will it be fine for my use case?


                Also, is the Adobe Cirrus server reliable?  I read one poster saying that "NAT" is bad.

                Why?  The Adobe sample seems to work awesome as far as I can tell!


                Now, I am planning on using this as part of a commercial project.  That being the case,

                I need reliability and low latentcy.  What is wrong with using a simple web service

                hosted from my own server?  As far as Adobe not releasing Cirrus for commercial use,

                what are my alternatives?  There has to be some viable (and simple to set up /

                understand) solutions for this.  I just need this set up and working!  I mean as awesome

                as this technology is, it should be out of Beta and stable enough for commercial

                applications by now.  I am an IT major, but not too strong when it comes to networking

                stuff.  This shouldn`t require a PhD in Telecommunications to get set up!  I have way too

                much on my plate with the AS programming as it is and I just don`t want to get sucked

                down the bottomless hole of acronyms, new languages, and networking / server

                technologies that always seems to go hand in hand with telecom applications.


                Sorry for the rant doognukem, but I`m sure you can understand my frustration.  I really do

                need to study this more.  Can you recommend any good books I can buy that give a good

                solid into to p2p streaming technologies, VoIP, etc...


                Thanks again!

                • 5. Re: Need Help Setting Up a Web Service!
                  doognukem Level 1

                  I understand your frustration, it does feel like you need to pull alot of pieces together to make this work. My suggestion is approach it in simple iterations, plan out the simplest thing you want to get done in a week and try to accomplish that for example:


                  1. write an AS client that connects to Cirrus and then sends it's peerID to your webservice
                  2. then write a bare bones webservice that allows  clients to request the available 1 to 1 connections over cirrus


                  Adobe Cirrus is reliable as a server (although you aren't allowed to use it for commercial products), the "reliability" issue is more to do with the RTMFP p2p connections which have to "punch a hole" through each users firewall to allow them to connect directly (most firewalls block ), and depending on their firewall's properties they may not be able to connect.


                  One solution to this is to have some type of central server that you can failover to and relay the P2P traffic (basically). Adobe provides the LCCS (Live Cycle Collaboration Service) which acts somewhat like Cirrus except it also provides.


                  1. It provides a central server that can relay traffic if a user cannot connect to P2P

                  2. It can act as the webservice to coordinate multiple clients into "rooms"/"lobbies"

                  3. You can use it for commercial products.