Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: java maskeraiding as firefox - how?

  1. #1
    Member
    Join Date
    May 2010
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java maskeraiding as firefox - how?

    this is a tough one, but theres got to be a way to do it. my program accesses urls, but when it tries google, google says
    NO! IM GIVING U A 403!
    because google doesn't like automated searches, it only wants browsers to visit google, not java programs.
    the way it does this most likely is with the php variable $_SERVER['HTTP_USER_AGENT']
    it tests for the browser type, and if its not one of the major browsers, it returns a 403.
    i need my java program to know when it is given this request, and i need to learn how to send back any string i want, because then i can tell google that java is firefox, when its not.


  2. #2
    Member
    Join Date
    May 2010
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java maskeraiding as firefox - how?

    uc.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)"); // Will set IE user agent
    got it, this may also be the solution to my previous post

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: java maskeraiding as firefox - how?

    Try this code:

    http://www.javaprogrammingforums.com...bsite-url.html

    It will spoof the connection tricking Google into letting you in. I use it myself to query Google...
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.