From 78a2d0d47a493ef7845c86d4a1ba3e9a77a071ff Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Aug 2017 19:36:43 +0100 Subject: proxy support and ILOv2 support --- INF/DSRx020.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'INF/DSRx020.pm') diff --git a/INF/DSRx020.pm b/INF/DSRx020.pm index d99cfad..fad319c 100644 --- a/INF/DSRx020.pm +++ b/INF/DSRx020.pm @@ -8,6 +8,7 @@ use IO::Socket::SSL qw(); use HTML::TreeBuilder; use HTTP::Request::Common; use LWP::UserAgent; +use LWP::Protocol::socks; use URI::Escape; use File::Temp qw/ tempfile tempdir /; use XML::Simple; @@ -477,7 +478,13 @@ sub view($$) { #print join( ' ', ( "java", "-cp", $cp, "com.avocent.video.Stingray", @$args ) ), "\n"; + if ($self->{proxy_host}) { + system( "echo","java", "-DsocksProxyHost=".$self->{proxy_host},"-DsocksProxyPort=".$self->{proxy_port},"-cp", $cp, "com.avocent.video.Stingray", @$args ); + system( "java", "-DsocksProxyHost=".$self->{proxy_host},"-DsocksProxyPort=".$self->{proxy_port},"-cp", $cp, "com.avocent.video.Stingray", @$args ); + + } else { system( "java", "-cp", $cp, "com.avocent.video.Stingray", @$args ); + } } @@ -604,6 +611,12 @@ sub new ($;$) { $self->{host} = $parm->{host} || "127.0.0.1"; + if (defined $parm->{proxy_host}) { + $self->{ua}->proxy([qw(http https)] => "socks://".$parm->{proxy_host}.":".$parm->{proxy_port}); + $self->{proxy_host}= $parm->{proxy_host}; + $self->{proxy_port}= $parm->{proxy_port}; + } + $self->{user} = $parm->{user} || "Admin"; $self->{password} = $parm->{password} || ""; -- cgit v1.2.3