Skip to content

Instantly share code, notes, and snippets.

@TvdW

TvdW/test.pl Secret

Created October 3, 2015 11:03
Show Gist options
  • Save TvdW/3f720b9c6ffcd71967c1 to your computer and use it in GitHub Desktop.
Save TvdW/3f720b9c6ffcd71967c1 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use IO::Socket::INET;
my $socket1= IO::Socket::INET->new(PeerPort => 12345, PeerAddr => '127.0.0.1') or die 'no connect';
print $socket1 "authenticate\r\n";
print $socket1->getline();
my $socket2= IO::Socket::INET->new(PeerPort => 12346, PeerAddr => '127.0.0.1') or die 'no connect';
print $socket2 "authenticate\r\n";
print $socket2->getline();
print $socket1 "setevents introduce\r\n";
print $socket1->getline();
while (my $line= $socket1->getline()) {
print $line;
chomp $line;
if ($line =~ /\A650 INTRODUCE (\S+) (\S+)\s*\z/) {
print $socket2 "perform-rendezvous $1 $2\r\n";
print $socket2->getline();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment