Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin::libs;
use YAML;
use Sniffer::RTMP;
my $dev = $ARGV[0] or die 'require device name';
$| = 1;
Sniffer::RTMP->new(
device => $dev,
callbacks => {
invoke => sub {
my ($dir, $packet, $method, $id, $args) = @_;
return unless $method eq 'connect';
my $connect_info = $args->[0];
warn Dump({
page => $connect_info->{pageUrl},
swf => $connect_info->{swfUrl},
rtmp => $connect_info->{tcUrl},
});
},
},
)->run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment