HTTP(S) request from Perl over proxy with IO::Socket only -


i have perl script put request https server , send file. request done io::socket::ssl .

$socket = new io::socket::inet(peeraddr => $host,peerport => $port,proto    => 'tcp'); $h ="put ".$path." http/1.0\r\n";     $h.="accept: */*\r\n";     ........     $h.="\r\n";  print $socket $h; 

but need request on proxy server

how easy way this? can configure prozy server set different types of connections (if there different types). s best type?

how request? understand, have connect proxy io::socket , put connect.

how like?

thanks

update 1. found solution http://search.cpan.org/~oleg/io-socket-socks-0.62/lib/io/socket/socks.pm module io::socket::socks need. not https. tried use io::socket::securesocks. fails time

#!/usr/bin/perl  use io::socket::securesocks;   $socket = io::socket::securesocks->new(               proxyaddr   => '127.0.0.1',               proxyport   => 8876,                 connectaddr => 'yahoo.com',               connectport => 443,               timeout     => 10               ) or die "error $!\n";  print $socket "get / http 1.1\r\n\r\n"; print join ('',<$socket>); 

it shows error. do wrong?

this proxy works fine curl in php , https links. proxy socks 5 proxy

i found solution myself. used module io::socket::socks::wrapper redirect requests socks5 proxy. added on beginning of script

use io::socket::socks::wrapper ( {     proxyaddr => 'proxy.addr',     proxyport => 8876, } ); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -