Showing posts with label internet. Show all posts
Showing posts with label internet. Show all posts

Thursday, January 11, 2007

How to refresh a page that is not loaded?

First of let us understand the heading of my post ;) If a page is already loaded in the browser, there are several methods to refresh it. You will find them all over the internet.
For example, you can use:-

  1. <equiv="refresh" content="5">
  2. location.reload(true)
  3. javascript:history.go(0)
  4. etc.
However, consider a different scenario. I typed the url of a page "A" that requires login. Now the page will redirect you to the login page "B". After you login successfully, you will again be redirected to the actual page that you requested, that is page A. Now your browser knows from its cache, that when you earlier requested page A, it was redirected to page B. So it will now not send a request for page A to server. It will directly load the contents of page B instead! Now browser is doing correct by trying to save network bandwidth and by trying to reduce server load. But in our case its a problem.
Now you will ask this scenario happens in most of the sites and they all work perfectly fine. The reason is that in most of the sites, when they redirect you after successful login, to page A, they change the url of A a little bit. That is mostly you will find that after you login, there will be some sid, or username appended to the url. That concatenation makes this url not same a A and so browser loads it all over again and the site seems to be working fine.(though the site maker has no idea about all this and was just lucky).
But I have a site where the url of page A does not changes. There are some restrictions and the url of Page A has to remain exactly same. So how do I solve the problem? I searched all over net but couldn't find.(though there must be some solution). But right now I am using this method:-

<html>
<body onLoad="document.form1.submit();" >
Login successful. You are being redirected to the page requested by you.
<form method="post" action="URL of the page to redirect to" name="form1">
</form>
</body>
</html>

Note that the above thing will ask the browser to use POST method. And browser knows that pages fetched with POST method are dynamic and it can't rely on cache. So it won't rely on cache and ask a copy of the page again from the server. Thats it.

PS: Even if the urls are same, browser will sometimes fetch the new copy from the server. This is just my observation. Because in my lab, I had no problem with the simple redirection. But I found that at few other places the cache copy was being used. So I had to use the post method. I guess this all depends on browser settings and proxy settings.

PS: The above problem happened with me with my IIIT LAN Browser project.

Monday, November 06, 2006

Now FuckProxy comes with a cool toolbar button!

Yes. I added a "FuckProxy Go" toolbar button just after the go button. This button will take you to the typed url through FuckProxy.
Had to spend 6 hours on it. Wasted my whole night. I am saying wasted because, just in 3 hours I have my endsem exam. And I haven't even started reading. Spent all time for a stupid FuckProxy Button.

TechnoratiTechnorati: , ,

Sunday, November 05, 2006

FuckProxy 0.1 Beta is released again!!

Yeah... This time FuckProxy is a firefox extension and not a greasemonkey script. So easier installation and easy to use!
So what are you waiting for? Get FuckProxy.
For those who don't know what is FuckProxy project, here is a brief description:-
Most of the time IIIT's proxy(204) goes down even when the ISP link is perfect. In such cases internet can be accessed using 200. FuckProxy firefox extension lets you do that by using 200 as a CGI Proxy.
Adds a "View this page with FuckProxy" or "Open Link Target with FuckProxy" option to your Firefox right-click menu, depending on where you click. Also adds a "View with FuckProxy" Button for the address bar.

There is one more good news:-
I have succeeded in my search for a IIIT system that connects to net without proxy. I am testing it for speed and then I will include it in my project.
Enjoy!!

TechnoratiTechnorati: , , ,

Friday, November 03, 2006

Finally FuckProxy 0.1 Beta is released!

I have been saying in the last 3-4 posts that FuckProxy is almost complete. Well now it is fully complete and I have formally released FuckProxy 0.1 Beta.
For more on "why and what of FuckProxy?", visit my previous post.

I found that most of the time IIIT's proxy(204) goes down even when the ISP link is perfect. In such cases internet can be accessed using 200. This Greasemonkey(what is Greasemonkey) script lets u do that by using 200 as a CGI Proxy.

How to install?

  1. Install Firefox (If you don't have it)
  2. Install Greasemonkey Firefox Extension (If you don't have it, and restart Firefox)
  3. Install FuckProxy
Thats it. Now whenever 204 is down, click on Tools->Greasemonkey->User Script Commands->Enable FuckProxy. And start browsing!
[Note : When you install FuckProxy for the first time, remember to refresh any one of the page. Or open a new tab and type some url.]

If you want to stop using FuckProxy then click on Tools->Greasemonkey->User Script Commands->Disable FuckProxy.

Have Fun!!

PS: Then name FuckProxy was coined by my friend Bharat Joshi. Thanks to him for providing me with such a creative name.

TechnoratiTechnorati: , , ,

One Alternative down

Out of the two alternatives that I came out with in my last post, the second one is down.
I searched for ways to how to change the url just before it is fetched. But could not find satisfying solutions.
But the first option is still alive. In fact, I got a few promising solutions. This site lists a few http proxy servers that have been made in python that do not need superuser privileges. The one that I downloaded requires python 2.4 and our 200 is still in the old age of 2.3. So I will have to select some other one. Lets see...
And yes FuckProxy is on its way. Its almost complete.

TechnoratiTechnorati: , , , , ,

Alternatives to FuckProxy

My mind travels faster than speed of light. FuckProxy is not even complete and I have already thought of two more approaches to tackle this same problem. And did I mention that the FuckProxy project is my 6th approach for creating a proxy. Well... none of them was perfect and so I keep trying newer and newer approaches. FuckProxy is a totally new approach that uses greasemonkey. And its almost over. Beta version is just coming.
Well... now the alternatives:-

1. I heard newer versions of python have some built-in library for creating proxy servers. I could run such a proxy server on 200 and bingo nothing else needs to be done. This is not the proxy that I have been making for so long. This one is not like anonymous proxy, but exactly like the 204 proxy using port 8080. The only possible glitch could be the requirement of superuser privileges. I have not seen yet whether it needs super user privileges or not.

2. I could make a firefox extension that changes each url just before it is fetched. This will be very easy if I could find how to do it. No more parsing the page source or DOM.

I have also thought to improve FuckProxy. I could install my proxy cgi scripts, that is presently on 200, on several other iiit systems that have direct access to internet and my greasemonkey script could use all of them at random to balance the load, enhancing the user experience!

TechnoratiTechnorati: , , , ,

FuckProxy Project is coming out fine

The FuckProxy project is coming out fine. Its almost over.
Its actually a combination of python cgi + greasemonkey script that lets IIITians to browse net even when 204 is down.
What and why?
Recently, IIIT Hyderabad appointed stupid system administrators which are unable to manage IIIT's servers properly. It has been observed that 204 (our proxy), goes down frequently even when the ISP link is perfect. So I thought why not create a proxy on our 200 that would allow users to browse net even when 204 is down. Note that 200 connects without proxy(204). So one could easily browse net using 200!
But there is still a problem. 200 itself is so slow that it delivers mail late by 1-2 days sometimes. So, my FuckProxy script gets extremely slow. So, I am searching for some other system in IIIT that connects without 204 and is not slow. Then I will use that machine for my FuckProxy script.

Another idea that is striking my mind right now is:-
IIITs net connection has gone extremely slow. Again thanks to the stupid sysadmins. I think that if this problem is due to misconfigurations with the proxy server and not due to the ISP link being slow, then I could use my FuckProxy script with some decent IIIT system that connects without proxy to provide better speed!! It would be so good. But first I have to search for such a decent machine. Lets see...

TechnoratiTechnorati: , ,