| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | BEGIN { | ||
| 4 | push @INC, './lib/'; | ||
| 5 | } | ||
| 6 | |||
| 7 | use STUN::Client; | ||
| 8 | use Data::Dumper; | ||
| 9 | |||
| 10 | $stun_client = STUN::Client->new; | ||
| 11 | |||
| 12 | $stun_client->stun_server('stun.xten.com'); | ||
| 13 | $stun_client->local_address('192.168.1.102'); | ||
| 14 | $r = $stun_client->get; | ||
| 15 | |||
| 16 | print Dumper($r); | ||
| 17 | |||
| 18 | print $stun_client->response->{ma_address}, | ||
| 19 | ':', | ||
| 20 | $stun_client->response->{ma_port}, "\n"; | ||
| 21 |