Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Default Trying to bypass proxy

    hey I am a beginner and stuck on something....
    My college has a proxy that I am trying to bypass...

    Everytime I try to open a page it redirects to a page that asks for policy acknowledgement.. for which we have to click a link..

    I want to bypass that clicking part.. for without clicking none of the internet applications work ...

    For suppose I type Google in the browser I get this page (trimmed_) :

    Java Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"> 
    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <title>Notification: Policy Acknowledgement</title> 
    </head> 
     <body>
     ...
     
    <p> 
    <a href="http://10.10.2.15/0:3600:86400:4ba74287/ad776dc33401e888760f72399c80c6ff/http://www.nitk.ac.in">Click here to accept this statement and access the Internet.</a> 
    </p> 
     
    <p> 
    Time: Mon, 22 Mar 2010 15:42:23 IST<br>IP Address: 172.16.54.143<br> 
    </p> 
     
    </body> 
    </html>
    Notice the <a> tag there.. that's what I want to capture.. I know how to parse HTML as such... Here's the snippet I am doing to open connection :

    Java Code:
    System.getProperties().put("proxySet",true);
    System.getProperties().put("proxyHost","10.10.2.15");
    System.getProperties().put("proxyPort",80);
    
    ucon = u.openConnection(); //ucon is URLConnection, u is URL
    Reader inp = new InputStreamReader((InputStream) u.getContent());
    my problem is that this returns a 403 error..... while if I open the URL in a browser ... I get the page I mentioned above... How can I read 'THAT' page in java... maybe the server detects the page is not being opened in a browser.....Any Ideas...

    Additional Question... Suppose I get the link... What should I do to simulate a 'CLICK' on it??? Can I just connect to that URL and the server would think the user clicked on it???

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Your school's routers are blocking your requests and sending you that error page. Unlike the movies, I seriously doubt you will find a way past them.

    To use the school's proxy, look at Proxy and URL.openConnection(Proxy proxy). That will allow you to follow the school's procedures without the annoying error pages.
    The Java Tutorial. Read it.

  3. #3
    g_ayyappan is offline Member
    Join Date
    Apr 2010
    Posts
    4
    Rep Power
    0

    Default

    Did you try using correct system properties. Please try with 'http.proxyHost' and 'http.proxyPort'

    Regards
    Ayyappan Gandhirajan

Similar Threads

  1. bypass unsigned app warning Leopard / Ubuntu
    By gabrielcik in forum New To Java
    Replies: 1
    Last Post: 03-04-2010, 03:18 PM
  2. Replies: 2
    Last Post: 07-13-2009, 05:45 AM
  3. how do you bypass the enter(/n) key in a program?
    By mtwisd in forum New To Java
    Replies: 1
    Last Post: 04-24-2009, 09:50 AM
  4. Http - proxy or non-proxy ?
    By Shiv in forum Networking
    Replies: 0
    Last Post: 04-11-2009, 09:07 AM
  5. bypass NTLM login
    By ruchsriv in forum Web Frameworks
    Replies: 0
    Last Post: 03-30-2009, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •