Hi,
This will be very difficult (probably not working at all). You would need a application which acts as a browser between the users browser and the facebook page, relays all cookies and adapts the headers / HTML content that all links will be rewritten to your server.
I would never try to do this because of the following points:
- Security risk for the users (someone could get the user/passwords of their FB accounts)
- Lot of work to do for rewriting each delivered HTML / JS
Anyway, if you still want to try it, you have to concern the following:
- You have to parse each HTML and JS File and rename the facebook.com domain to your domain (perhaps in the JS the domain will be composed in some way, then it would not be possible for your application)
- pass all cookies coming from the client to the request you make (you have to re-create each cookie and rename the domains)
- pass all cookies coming from the request (to facebook.com) to the client (as in the opposite way, you have to re-create the cookies and rename the domains)
Once again, I would not try to do it because it is too much work for the fact that you could end up without having any piece of working code.
Also I don't know if Facebook would be happy to see if someone would open a big security risk by using your proxy.
Just my 5 cents :)
Best regards,
Stops