3

I am trying to send a live stream from FMLE to a CDN, but passing through our FMS (installed locally); so the chain I have is:

FMLE => FMS => CDN

Now, publishing to the CDN is username/password protected. If I try to connect directly from FMLE to the CDN, FMLE opens a layer asking for credentials to "Connect to FMS" - I fill the form with username and password provided by the CDN, click on OK, and everithing works fine.

The problem comes when introducing the FMS: I created a simple application in FMS to republish the stream (simplified code below), and it works fine for CDN that don't ask for username/password, but I'm not able to figure out how to send credentials from the FMS application to the CDN.

Here the code I'm using (it's simplified, I'm putting here only the core code):

application.onPublish = function (oClient, oStream)
{
    application.nc = new NetConnection ();  // Creating new NetConnection
    application.nc.connect (FMS_url);  // Connecting to CDN

    application.ns = new NetStream (application.nc);  // Creating new NetStream
    application.ns.setBufferTime (1);  // Setting buffer time
    application.ns.attach (oStream);  // Attaching incoming streaming
    application.ns.publish ("stream_name", "live");  // Publishing
}

More info:

  • We do need to pass through FMS, so "why don't you stream directly to the CDN ?" is not an option :-)
  • FMS URL and credentials are correct, it's not any typing error :-(
  • After application.nc.connect(), the onStatus event is fired with NetConnection.Connect.Success, but inmediately after that it is fired again with NetConnection.Connect.Closed (without any other info).

Following suggestions found on the web, I tryed things like

application.nc.connect (FMS_url);

or

application.nc.connect (FMS_url + "?username&password");

or adding

application.nc.addHeader ("Credentials", false, { userid: "username", password: "password" });

... but nothing seems to work, the result is always the same.

Any suggestion ? :-) Thank you in advance, best regards

ketan
  • 19,129
  • 42
  • 60
  • 98
Andrea
  • 396
  • 2
  • 7
  • 1
    +1 for the very detailed question with everything that has been tried, much better then the other one (http://stackoverflow.com/questions/32442024/authentication-using-netconnection-actionscript) – karfau Sep 08 '15 at 21:59
  • I wrote this question first, but people tend to ignore long and detailed questions, so I wrote the other one to try catching answers :-) – Andrea Sep 09 '15 at 23:08

0 Answers0