Answer the question
In order to leave comments, you need to log in
How to send requests from LWP through socket tunnel returned by Net::OpenSSH?
There is a code like this:
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use feature qw/say switch unicode_strings/;
use Data::Dumper;
use Net::OpenSSH;
use LWP::UserAgent;
my $ssh = Net::OpenSSH->new("192.168.1.1", user => 'user', password => 'PaSsWoRd' );
$ssh->error and die "Couldn't establish SSH connection: ". $ssh->error;
my ($socket, $pid) = $ssh->open_tunnel('test.com', 80);
say "Socket[$socket] PID[$pid]";
my $ua = LWP::UserAgent->new;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question