Trying to set up WWW::Mechanize::Firefox and access Firefox using Perl.
I've installed the module and its dependencies. I'm not sure if I've understood this module properly but I'm running it on a unix (shared) server to access and drive Firefox running on a pc client.
I'm getting an error:
Failed to connect to , at MozRepl/RemoteObject.pm at line...
I've read various posts about setting up remote access in RemoteObject.pm and tried all approaches. Still get the error. Right now I have a little test program (http://kamasiri.com/kohkood/cgi-bin/testMechanize.cgi), which is basically as follows:
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use WWW::Mechanize::Firefox;
print "Content-type: text/html\n\n";
my $mech = WWW::Mechanize::Firefox->new();
$mech->get('http://kamasiri.com');
$mech->eval_in_page('alert("Hello Firefox")');
print "<html><body><p>yeehah!</p></body></html>";
exit;
And in RemoteObject.pm I have edited near the top as follows:
# use $ENV{MOZREPL} or localhost:4242
my $remote_machine = $ENV{REMOTE_ADDR};
$ENV{REMOTE_ADDR} = "$remote_machine:4242";
my $repl = MozRepl::RemoteObject->install_bridge(
repl => "$ENV{REMOTE_ADDR}"
);
Am i doing something wrong here?
I've also tried hard coding the IP address of the PC client into the code. Still the same error.
Firefox is running and the MozRepl add-on is loaded and running (that's the normal source of this error, I've read).
I wondered if it's a firewall issue so I've tried on various machines including a mobile. Still the same. The fact it's not printing out the ip address and port in the error message suggest to me it's not taking these as options into the program properly.
I also wondered if its a telnet privilege issue because I'm on a shared server?
Any ideas what I can try next?