#!/usr/bin/perl use LWP::UserAgent; use strict; push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, "LocalPort" => "7000"); my $a = new LWP::UserAgent(); $a->proxy('http', 'http://ofgfw1.owfg.com:8080/'); $a->get("http://mysite.com/"); #### my $url='mysite.com'; $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1)); $req = HTTP::Request->new(POST => 'mysite.com/user_login.php'); $req->content_type('application/x-www-form-urlencoded'); $req->content('username=peter&&passwd=password&&login=yes'); my $res = $ua->request($req); $req = HTTP::Request->new( POST => $url . 'post_something.php' ); $req->content_type('application/x-www-form-urlencoded'); $req->content($data); $res = $ua->request( $req ); #### $ua->proxy('http', 'http://ofgfw1.owfg.com:8080/'); #???!!!