Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

perl useragent spoofing ip address?

  • 07-02-2002 07:32PM
    #1
    Registered Users, Registered Users 2 Posts: 944 ✭✭✭


    is there anyway you can alter a user agent in some perl code to give it a fake ip address. Is it even possible?

    use URI::URL;
    use LWP::UserAgent;
    use HTTP::Request;
    use HTTP::Request::Common;
    use HTTP::Request::Form;
    my $ua = LWP::UserAgent->new;
    my $url = url "http...";
    my $res = $ua->request(GET $url);

    like is there any way to alter $ua to give it a differnet ip address?


Comments

  • Closed Accounts Posts: 1,295 ✭✭✭Meh


    The HTTP user agent has nothing to do with your IP address. You can't spoof your IP address for a http request anyway -- how would the web server send the information back to you? The best you can do is send your request through a proxy.


  • Registered Users, Registered Users 2 Posts: 944 ✭✭✭nahdoic


    yeah thx. Setting up the proxy worked like a charm.

    $ua->proxy('http' => 'http://204.97.153.22:8080');

    :)


Advertisement