views:

898

answers:

8

I work as a contractor/freelancer. At most client sites a lot of websites are blocked. Specifically Gmail and Facebook which I really would like access to while on assignment.

I know there are a lot of proxy/anonymiser websites out there that allow you to use their website to circumvent the website filtering of the business IT policy but most of these sites contain malware, objectionable images and are blocked anyway where I am currently on assignment.

I own a number of domains and would like to write my own proxy/anonymiser and host it on one of these domains to let me access Gmail and Facebook while on client site. The url will be low profile, low traffic so should not get blocked, I can already access the urls now.

How would I go about writing the code for this? also if there are any opensource projects or apps I can run on my webserver that will give me this functionallity I would happily do this/buy this product.

I currently have shared hosting but would consider dedicated/virtual if necessary.

What are the things I need to consider to make this work? I don't mind spending money, time to get this working as I have made a decision to remain contracting for the foreseeable future and this will benefit me greatly.

Thanks.

I know it's probably hard to write this, but can anyone post links to some code that does this as a starting point? I have tried searching but can't find anything, I'm really not sure what search terms to use.

+6  A: 

Get yourself a reasonable data package from your mobile phone provider, job done. Since you are a freelancer this will be a more cost effective solution than spending your valueable time building such a thing.

AnthonyWJones
As a contractor, it's a business expense too! :)
rie819
This certainly is one option I am thinking of buying an iphone or blackberry. I'd prefer not though as the experience on a computer is much better full blown gmail, also I don't want to be seen to be always on my phone at my desk. If this is a website I can manage this much more effectively by resizing a window, keeping it small when in use, minimised when not in use.
m3ntat
@m3ntat: "data package" ... that allows you to use your phone as a modem for your lappy.
xk0der
@xk0der another useful option except I don't own a laptop and would prefer to avoid buying one and brining it in each day. But I take your point maybe a small netbook with a mobile usb dongle for internet access would work. All quite costly and fairly obvious in the workplace though.
m3ntat
This is a horrible, horrible answer. It's a legitimate question and a your answer is a cop out. For shame.
Merritt
@Merritt: I don't recall indicating that the question as illegitmate, had I would have voted to close it. Cop out would be to not answer (or post a comment and not offer my opinion as an answer). I feel no such shame, I stand by this answer.
AnthonyWJones
A: 

Most proxies get blocked soon. So expect it to be closed soon. When people start using it more then most "blockers" will automatically detect it and start blocking it.

You will get lot of proxy website clones if you search. Check this one too.

Shoban
As I said this won't be advertised as a proxy I will use it only for me, the url works now is a personal site, will be low traffic so should not attact being blocked. Unless you are saying website filtering software in businesses detect and scope for certain behaviour on sites then add these urls to blacklists and my site would come under that scrutiny, is what you are saying?
m3ntat
+1  A: 

Sounds like hard work to write your own. One place I worked, I used GoToMyPC to access my machine at home and browse to any blocked sites from that machine. GoToMyPC was an authorized tool because it allowed people to work from home and didn't haven't firewall implications.

Joe
I did consider this also as I leave my home PC on all the time so could remote in and access. However, gotopc, logmein and live mesh are all blocked which provide this functionallity.
m3ntat
Stop it and think of the environment and your downloads!
Robert
@Robert are you making a joke? I am confused by your comment.
Merritt
+4  A: 

Writing your own proxy is quite difficult (I've tried years ago!). Unless you're actually trying to learn all the complexities, if you just want your own proxy solution you'd probably do fine just installing Squid on your own server with Webmin or something to give an easy configuration interface.

Chet
Hi Chet, can you tell me more about Squid and Webmin and how they can help me. Any links to articles about how to set up to use to provide this solution? Also would this work in shared hosting?
m3ntat
Squid can be a proxy server. I installed it on Ubuntu server. Webmin is a web app that lets you administer all kinds of things on a remote server. I doubt a shared host would let you install your own software.
Chet
Writing your own proxy is hard. Writing your own lame, mostly working but slightly quirky proxy is easy (e.g. just using an Asp.Net system that forwards the right data). This kind of thing is probably sufficient for m3ntat's needs, and can be password-protected to prevent abuse by other people.
Brian
+2  A: 

If you own a server on the internet you can install OpenVPN, a VPN that can work over SSL port 443. So all proxies/firewalls have to allow this if they allow any web access at all. Wikipedia link for OpenVPN

I've never tried it myself, just read a lot about it.

Writing to your own proxy is very very hard. You have to stay up to date with latest developments to keep it operational. Especially since a lot of web sites nowadays make heavy use of AJAX, and a lot of URLs are generated in script code, so simple replacement of all href attributes won't work.

But it is a good way to learn a lot about the HTTP protocol and all the latest web technologies ;)

chris166
+2  A: 

Hi..

this blog may help u to start.

http://techkiddos.wordpress.com/2009/07/04/how-we-developed-a-model-proxy-site-anonymizer-with-asp-net/

[How we developed a Model Proxy site (Anonymizer) with ASP.NET..]

@boo This looks good and is what I'd like to implement but to work for Gmail mainly and secondary Facebook. Will take a look in more detail shortly.
m3ntat
@boo thanks for the link. I read through it and it does provide a nice jumping off point.
Merritt
A: 

strange mental jump, that, if you do not wish to use somebody else's proxy, you go write your own. Why not just use squid? If you want to do it as an exercise, there are extremely simple java proxy servers around. Just take the source code and slim it down. Not very efficient though. I am not sure if I would want you as a contractor lol

Most other people's proxies hosted on their domains are blocked. I am looking for suggests above for a component I can host on my own website but couldn't find anything, else I'm looking for suggestion on how to write my own. What is Squid, is it easy to setup and host myself to achieve what I am looking for?
m3ntat
Also is it possible to setup on a Windows shared hosting account? mine supports asp.net/php I think both under IIS
m3ntat
A: 

Here's what you need to create a (good) proxy:

  1. Request the page (remember that you need to support SSL for facebook!
  2. Rewrite any part of the page that contains absolute urls and rewrite them to use your script
  3. Parse and rewrite the css
  4. Parse/Remove any javascript. You might want to give JS function hooking a shot
  5. Echo the page

It's a lot more complicated than you'd think at first.

Here's an example from codeproject.net: http://www.codeproject.com/KB/aspnet/asproxy.aspx

Here's an example of a nice javascript hook if you decide to make your own:

var old_open = window.open;
window.open = function(URL, windowName, features) // overwrite window.open calls
{
URL = "http://example.com/proxy.php?url=" + escape(URL);
return old_open(URL, windowName, features);
};

If this code executes first any future calls to window.open will be rewritten to open up the new window using your script. Of course this won't help with things like window.location but it's a start

Chris T