View Single Post
  #4  
Old 12-23-2009, 02:14 AM
hyc hyc is offline
RTMPdump team
 
Join Date: Dec 2009
Posts: 169
hyc will become famous soon enoughhyc will become famous soon enough
Default

Re: rtmpe and swf verification problems with tv4play.se


I used this:

http://lists.mplayerhq.hu/pipermail/...er/000181.html:
Quote:
Originally Posted by hyc
> Author: hyc
> Date: Tue Dec 22 07:10:37 2009
> New Revision: 108
>
> Log:
> Add dummy RTMP server. Doesn't serve any data, just sucks up
> connection parameters from a client.
>
> Added:
> trunk/rtmpsrv.c
> Modified:
> trunk/Makefile
> trunk/log.h

This started as a copy of streams.c and then I ripped out all the HTTP code
and added in all the RTMP server side handling. I had originally planned to
write a complete transparent proxy, but I'm not sure that's really necessary
at this point.

All you need to do is redirect your Flash clients to the machine running this
server and it will dump out all the connect / play parameters that the Flash
client sent. The simplest way to cause the redirect is by editing /etc/hosts
when you know the hostname of the RTMP server, and point it to localhost while
running rtmpsrv on your machine.

The other way on Linux is to use iptables to redirect all outbound RTMP
connections. You can do this as root:

iptables -t nat -A OUTPUT -p tcp --dport 1935 -j REDIRECT

In my original plan I would have the transparent proxy running as a special
user (e.g. user "proxy"), and regular flash clients running as any other user.
In that case the proxy would make the connection to the real RTMP server. The
iptables rule would look like this:

iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner proxy -j
REDIRECT

That should give you some idea of where to go from here.
The output from your web page was this:

Code:
RTMP Server v2.0
(c) 2009 Andrej Stepanchuk, Howard Chu; license: GPL

Streaming on rtmp://0.0.0.0:1935
DEBUG: serverThread: accepted connection from 192.168.1.21 to 24.143.203.55

DEBUG: SHandShake: Type Requested : 03
DEBUG: SHandShake: Client Uptime : 77360913
DEBUG: SHandShake: Player Version: -128.0.3.2
DEBUG: SHandShake: Handshaking finished....
DEBUG: ServePacket, received packet type 14, size 442 bytes
DEBUG: ServePacket, received: invoke 442 bytes
DEBUG: (object begin)
DEBUG: Property: <Name:                  no-name., STRING:	connect>
DEBUG: Property: <Name:                  no-name., NUMBER:	1.00>
DEBUG: Property: <Name:                  no-name., OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name:                       app, STRING:	tv4ondemand?ovpfv=2.1.2>
DEBUG: Property: <Name:                  flashVer, STRING:	LNX 10,0,42,34>
DEBUG: Property: <Name:                    swfUrl, STRING:	http://www.tv4play.se/polopoly_fs/1.939636.1260780980!approot/superspelarflashlet.swf>
DEBUG: Property: <Name:                     tcUrl, STRING:	rtmp://cp70051.edgefcs.net:1935/tv4ondemand?ovpfv=2.1.2>
DEBUG: Property: <Name:                      fpad, BOOLEAN:	FALSE>
DEBUG: Property: <Name:              capabilities, NUMBER:	15.00>
DEBUG: Property: <Name:               audioCodecs, NUMBER:	3191.00>
DEBUG: Property: <Name:               videoCodecs, NUMBER:	252.00>
DEBUG: Property: <Name:             videoFunction, NUMBER:	1.00>
DEBUG: Property: <Name:                   pageUrl, STRING:	http://www.tv4play.se/noje_och_humor/forkvall?videoId=1.1357384>
DEBUG: Property: <Name:            objectEncoding, NUMBER:	3.00>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: ServeInvoke, client invoking <connect>
DEBUG: Invoking _result
DEBUG: ServePacket, received packet type 11, size 22 bytes
DEBUG: ServePacket, flex message, size 22 bytes, not fully supported
DEBUG: (object begin)
DEBUG: Property: <Name:                  no-name., STRING:	_checkbw>
DEBUG: Property: <Name:                  no-name., NUMBER:	0.00>
DEBUG: (object end)
DEBUG: ServeInvoke, client invoking <_checkbw>
DEBUG: ServePacket, received packet type 11, size 26 bytes
DEBUG: ServePacket, flex message, size 26 bytes, not fully supported
DEBUG: (object begin)
DEBUG: Property: <Name:                  no-name., STRING:	createStream>
DEBUG: Property: <Name:                  no-name., NUMBER:	2.00>
DEBUG: (object end)
DEBUG: ServeInvoke, client invoking <createStream>
DEBUG: Invoking _result
DEBUG: ServePacket, received packet type 04, size 10 bytes
DEBUG: ServePacket, received packet type 04, size 10 bytes
DEBUG: ServePacket, received packet type 11, size 104 bytes
DEBUG: ServePacket, flex message, size 104 bytes, not fully supported
DEBUG: (object begin)
DEBUG: Property: <Name:                  no-name., STRING:	play>
DEBUG: Property: <Name:                  no-name., NUMBER:	0.00>
DEBUG: Property: NULL
DEBUG: Property: <Name:                  no-name., STRING:	mp4:/mp4root/2009-11-25/A53G0CFN-FORKVALLHALSA_885464_T6MP43_.mp4>
DEBUG: Property: <Name:                  no-name., NUMBER:	0.00>
DEBUG: Property: <Name:                  no-name., NUMBER:	-1000.00>
DEBUG: (object end)
DEBUG: ServeInvoke, client invoking <play>

Last edited by Stream Recorder : 01-01-2010 at 04:35 AM. Reason: added example output
Reply With Quote