Can PyAMF interface to Flash Media Server directly?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Can PyAMF interface to Flash Media Server directly?

David Santinoli

Hallo,
  as a novice in this field I know it's a naive question, but is it
possible to use the client RemotingService class to query a Flash Media
Server directly, or do I require some sort of "glue" in between?

I have a very simple test app running on FMS, exposing a method foo()
returning the current timestamp.  I modified the client example at
http://pyamf.org/tutorials/general/client.html but after the POST, the
client hangs:

2010-08-13 18:01:43,978 INFO  [root] Connecting to 'http://server/test/i1'
2010-08-13 18:01:43,978 DEBUG [root] Referer: None
2010-08-13 18:01:43,978 DEBUG [root] User-Agent: 'PyAMF/0.6b1'
2010-08-13 18:01:43,978 DEBUG [root] Adding request foo()
2010-08-13 18:01:43,978 DEBUG [root] Executing single request: /1
2010-08-13 18:01:43,978 DEBUG [root] Removing request: /1
2010-08-13 18:01:43,978 DEBUG [root] AMF version: 0
2010-08-13 18:01:43,979 DEBUG [root] Sending POST request to http://server/test/i1

until FMS rips the connection after some time and the client throws an
exception.

The TCP connection is properly established, but the logs on FMS side (at
the default loglevel) reveal nothing.

Do I need to learn and speak RTMP?

Thanks,
 David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

Nick Joyce
Hi David,

On 14 Aug 2010, at 02:06, David Santinoli wrote:

>
> Hallo,
>  as a novice in this field I know it's a naive question, but is it
> possible to use the client RemotingService class to query a Flash Media
> Server directly, or do I require some sort of "glue" in between?
>
> I have a very simple test app running on FMS, exposing a method foo()
> returning the current timestamp.  I modified the client example at
> http://pyamf.org/tutorials/general/client.html but after the POST, the
> client hangs:
>
> 2010-08-13 18:01:43,978 INFO  [root] Connecting to 'http://server/test/i1'
> 2010-08-13 18:01:43,978 DEBUG [root] Referer: None
> 2010-08-13 18:01:43,978 DEBUG [root] User-Agent: 'PyAMF/0.6b1'
> 2010-08-13 18:01:43,978 DEBUG [root] Adding request foo()
> 2010-08-13 18:01:43,978 DEBUG [root] Executing single request: /1
> 2010-08-13 18:01:43,978 DEBUG [root] Removing request: /1
> 2010-08-13 18:01:43,978 DEBUG [root] AMF version: 0
> 2010-08-13 18:01:43,979 DEBUG [root] Sending POST request to http://server/test/i1
>
> until FMS rips the connection after some time and the client throws an
> exception.
>
> The TCP connection is properly established, but the logs on FMS side (at
> the default loglevel) reveal nothing.
>
> Do I need to learn and speak RTMP?

It depends, if the services that you are trying to get to are exposed via an HTTP interface then the PyAMF client is the way to go. Otherwise you are indeed going to need to be able to speak RTMP. The remoting payload is nothing like what is required to send a 'call' event in an RTMP stream.

Cheers,

Nick
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

David Santinoli
On Sat, Aug 14, 2010 at 06:14:04AM +1000, Nick Joyce wrote:

> On 14 Aug 2010, at 02:06, David Santinoli wrote:
> > The TCP connection is properly established, but the logs on FMS side
> > (at the default loglevel) reveal nothing.
> >
> > Do I need to learn and speak RTMP?
>
> It depends, if the services that you are trying to get to are exposed
> via an HTTP interface then the PyAMF client is the way to go.
> Otherwise you are indeed going to need to be able to speak RTMP. The
> remoting payload is nothing like what is required to send a 'call'
> event in an RTMP stream.

Hi Nick,
  thanks for your reply.

Do you think is it possible to have FMS listen for AMF-over-HTTP
requests?  I could find no parameters to tweak in its configuration -
but I'm no expert here.

Alternatively, how could I wrap the remote method invocation in RTMP?
Would RTMPy be the best way to go?  (The dependence on Twisted sounds a
bit overkill in my case, as I just need to impersonate a client
injecting requests into the FMS.)

Thanks,
 David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

Jesse Warden-2
FMS has RPC calls out.  So, if you want FMS to make a call to pyamf, it needs to make the call, and handle the response.  It doesn't go the other way; pyamf to FMS.  I did this a long time ago with AMFPHP, but I was a misguided soul back then that didn't know python.

Most of the code in FMS is AS1/JavaScript running on the Rhino engine.  So, you'll find a lot of old, yet, accurate examples on Google because of that.  Do you have some code you're using on the back-end that you could post/pastebin?  I have an FMS server up and running I could help test... assuming you have a Python/PyAMF server I can test against.

On Sat, Aug 14, 2010 at 6:01 AM, David Santinoli <[hidden email]> wrote:
On Sat, Aug 14, 2010 at 06:14:04AM +1000, Nick Joyce wrote:
> On 14 Aug 2010, at 02:06, David Santinoli wrote:
> > The TCP connection is properly established, but the logs on FMS side
> > (at the default loglevel) reveal nothing.
> >
> > Do I need to learn and speak RTMP?
>
> It depends, if the services that you are trying to get to are exposed
> via an HTTP interface then the PyAMF client is the way to go.
> Otherwise you are indeed going to need to be able to speak RTMP. The
> remoting payload is nothing like what is required to send a 'call'
> event in an RTMP stream.

Hi Nick,
 thanks for your reply.

Do you think is it possible to have FMS listen for AMF-over-HTTP
requests?  I could find no parameters to tweak in its configuration -
but I'm no expert here.

Alternatively, how could I wrap the remote method invocation in RTMP?
Would RTMPy be the best way to go?  (The dependence on Twisted sounds a
bit overkill in my case, as I just need to impersonate a client
injecting requests into the FMS.)

Thanks,
 David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

David Santinoli

Hi Jesse,

On Sat, Aug 14, 2010 at 11:07:42AM -0400, Jesse Warden wrote:
> FMS has RPC calls out.  So, if you want FMS to make a call to pyamf,
> it needs to make the call, and handle the response.  It doesn't go the
> other way; pyamf to FMS.

I thought PyAMF could also act as a client for FMS, but maybe it was a
misinterpretation on my side.

> Most of the code in FMS is AS1/JavaScript running on the Rhino engine.
> So, you'll find a lot of old, yet, accurate examples on Google because
> of that.
> Do you have some code you're using on the back-end that you could
> post/pastebin?  I have an FMS server up and running I could help
> test...  assuming you have a Python/PyAMF server I can test against.

The server-side code I'm testing with is trivial:

        application.onConnect = function(currentClient,clientData)
        {      
                this.acceptConnection(currentClient);
                currentClient.myMethod = function()
                {              
                return '12345';
                };
        };

Unfortunately I'm running no Python server, just a FMS on a LAN.

Thanks,
 David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

Thijs Triemstra
Here's a FMS example, and like Jesse said, FMS can only act like an AMF client and call PyAMF, not the other way around.

http://pyamf.org/tutorials/general/helloworld/ssa1.html

Cheers,

Thijs

On 15 Aug 2010, at 10:45, David Santinoli wrote:

>
> Hi Jesse,
>
> On Sat, Aug 14, 2010 at 11:07:42AM -0400, Jesse Warden wrote:
>> FMS has RPC calls out.  So, if you want FMS to make a call to pyamf,
>> it needs to make the call, and handle the response.  It doesn't go the
>> other way; pyamf to FMS.
>
> I thought PyAMF could also act as a client for FMS, but maybe it was a
> misinterpretation on my side.
>
>> Most of the code in FMS is AS1/JavaScript running on the Rhino engine.
>> So, you'll find a lot of old, yet, accurate examples on Google because
>> of that.
>> Do you have some code you're using on the back-end that you could
>> post/pastebin?  I have an FMS server up and running I could help
>> test...  assuming you have a Python/PyAMF server I can test against.
>
> The server-side code I'm testing with is trivial:
>
> application.onConnect = function(currentClient,clientData)
> {      
> this.acceptConnection(currentClient);
> currentClient.myMethod = function()
> {              
> return '12345';
> };
> };
>
> Unfortunately I'm running no Python server, just a FMS on a LAN.
>
> Thanks,
> David
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

David Santinoli
On Mon, Aug 16, 2010 at 06:57:35PM +0200, Thijs Triemstra | Collab wrote:
> FMS can only act like an AMF client and call PyAMF, not the other way
> around.

Hi Thijs,
  just to get some more insight - is it because of the lack of a RTMP
layer in PyAMF?  Or is there some other technical reason?

Thanks,
 David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

Nick Joyce
PyAMF does not include the relevant RTMP layer that is required to get this working. I would point you in the direction of RTMPy but its a fair state of disrepair atm. This is next on my priority list. If you want, I could work with you on this issue and get RTMPy working for you

On 18 Aug 2010, at 00:09, David Santinoli wrote:

> On Mon, Aug 16, 2010 at 06:57:35PM +0200, Thijs Triemstra | Collab wrote:
>> FMS can only act like an AMF client and call PyAMF, not the other way
>> around.
>
> Hi Thijs,
>  just to get some more insight - is it because of the lack of a RTMP
> layer in PyAMF?  Or is there some other technical reason?
>
> Thanks,
> David
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

David Santinoli
On Wed, Aug 18, 2010 at 01:03:49AM +1000, Nick Joyce wrote:
> PyAMF does not include the relevant RTMP layer that is required to get
> this working. I would point you in the direction of RTMPy but its a
> fair state of disrepair atm. This is next on my priority list. If you
> want, I could work with you on this issue and get RTMPy working for
> you

Hi Nick,
  thanks a lot for caring.  I would be more than glad to collaborate on
this, although currently I am in the process of evaluating alternatives
as I am a bit uneasy with the dependence on Twisted -- a framework I
have very little experience with.

Anyway, should you need a tester, feel free to get back me.

Thanks,
 David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Can PyAMF interface to Flash Media Server directly?

Thijs Triemstra
Hi David,

On 20 Aug 2010, at 23:58, David Santinoli wrote:

> On Wed, Aug 18, 2010 at 01:03:49AM +1000, Nick Joyce wrote:
>> PyAMF does not include the relevant RTMP layer that is required to get
>> this working. I would point you in the direction of RTMPy but its a
>> fair state of disrepair atm. This is next on my priority list. If you
>> want, I could work with you on this issue and get RTMPy working for
>> you
>
> Hi Nick,
>  thanks a lot for caring.  I would be more than glad to collaborate on
> this, although currently I am in the process of evaluating alternatives
> as I am a bit uneasy with the dependence on Twisted -- a framework I
> have very little experience with.
That makes a lot of sense, and it's also one of the reasons RTMPy is in the state it's in I believe; there aren't enough developers that a) have enough understanding of Twisted *and* b) are interested in RTMP, or the Flash Player for that matter. Or maybe people prefer to stick to proprietary software like FMS or keep their solutions to themselves, I don't know..

Cheers,

Thijs
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment