Thursday, December 23, 2010

Share your programming knowledge; don't retain it

A while back, I sought some information about writing emulators. I thought up a general idea of how an emulator would work just to get my brain thinking in that mode. Once I had a plan, I searched the web for forums, articles, and people to correspond with about emulators. (After all, part of the whole programmer/hacker ethic is not reinventing the wheel.)
Finally, I had found a forum. Good and bad came from that. The good was that the forum and discussion confirmed my general plan (I was happy that I had thought of emulating systems the same way that others do); the bad was that some user completely disregarded the let's-not-reinvent-the-wheel idea. Basically, he or she wrote that anyone that has to look up how to write an emulator is not smart enough - and will never be able to - write an emulator.
This bothered me for a multitude of reasons:
  1. His or her statement meant that he believed in reinventing the wheel. After all, if you cannot ask for help, you are your only resources and must, as a result, reinvent the wheel.
  2. He or she clearly either do not know how to write one themselves - otherwise, they would have at least posted something more helpful - or they are just ignorant, or both.
Quite frankly, I believe that information about programming should be spread. I do not mean just give away code for people to copy; I mean prompt them, have them learn on their own, but help them as soon as they hit a bump. There truly is no point to postpone their acquisition of knowledge. Think of postponing that acquisition as slowing down the general advancement of tech knowledge.

On a final - and unrelated - note: if anyone is interested in writing an emulator with me, comment and we could possibly set up some repository for the code. Nevertheless, I'll finish up my emulator, regardless of whether I have any takers.

Share.

Proxy Server

General Information:
Essentially, a proxy server is a server that connects a computer to another server. They are usually used to get access to a blocked website server.

Let me explain - as the previous definition can be confusing without an example. To open a web page, a computer must connect to a server. (Think of a server as another computer that stores a website in a file; picture the file as an object.) With that said, when you want to load a website, the computer you are using connects to that website server and downloads the file. Now, in a school - or work - setting, the administrators (the people that control the computer system) can block access to a server; and thus, block access to a webpage file.

To bypass that, someone can connect to a proxy server, which is NOT blocked, as long as the administrators do not know about it. This server can ask the computer what site the computer wants to connect to. Then, the proxy server can download the appropriate website server's web page data/file and send it back to the computer that could not previously access it.

Basically, the proxy server downloads the webpage file from the blocked server and saves the webpage file on the proxy server so that any computer can access it. That way, your computer can get the same webpage that they wanted to get from the blocked website, without ever actually connecting to that site's server.
As you can see, someone can access a blocked website through a proxy server.

Mind you that proxy servers can be blocked by administrators - they aren't impervious - because once the server is used, the administrators can block it.

Real life example:
Let me, now, give you a real life example. Say I am at school and want to go to "http://www.yahoo.com".
Now, let's pretend my school blocks "http://www.yahoo.com". What I would do is go to the webpage of a proxy server - just like I would with any other website. I would type in the "http://www.yahoo.com". The proxy server would go to "http://www.yahoo.com", download the webpage, and send it back to me. Now, I have the "http://www.yahoo.com" webpage, which was blocked; and I didn't have to actually visit "http://www.yahoo.com".

Simplified definition:
In sum, a proxy server duplicates the website that you want by copying the websites files; and then, it sends the files back to the user.

--------------

Extra:
Of course, in real life, proxy servers are more complex: they have to write an interface for the user; they have to interact with other servers; and, they have to adjust links and functions in the page so all interactions are directed through the proxy server (trying to direct links and functions through the blocked website would not work, because the blocked website is blocked). However, the above examples, etc, should be enough to give someone a general understanding of proxy servers.


Here I just want to write some of the extra considerations and specifics of running a proxy server.
It seems that the programmer of the proxy server would have to adjust all of the links on the webpage. Such functionality can be achieved by simply removing the domain name of the original, blocked website from the links, which tells the browser to apply all links to the end of the current - proxy - domain name. Mind you that advanced websites won't include the domain name in their website, because it is implied that the domain name that the website's links apply to should be the active website, unless explicitly specified otherwise.
Also, the proxy server would have to crawl the website to download all of the necessary files. This would only be hard if the website's robot file prevented crawling, and, as a result, prevent finding and downloading the necessary files.

UPDATES:
This article may or may not be updated in the future. If I decide to make my own proxy server for experience purposes, I will most likely provide an update that will include my experiences, lessons I've learned, etc.

Search This Blog