Need to display a website page to user behind firewall

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

Need to display a website page to user behind firewall

Post by voltrader »

I have a friend who works behind a firewall that prevents viewing of almost every sports page.

Since Fantasy season is in full swing :D he's desperately looking for a way to view stats on yahoo. He doesn't have to be logged-in.

What's the best way to do this?

I have a server which is not blocked by his firewall. What's the best way of capturing a certain page and displaying it again?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

[php_man]file_get_contents[/php_man]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Phen is partially right.. it involves [php_man]file_get_contents[/php_man](), but if there are any external streams needed from that server, they likely will be blocked too. So, it's a combination of [php_man]file_get_contents[/php_man]() (or my preferred for this, [php_man]curl[/php_man]) and some regular expression function calls ([php_man]preg_replace[/php_man]) to switch all the external file references in the page to usable ones. You're basically building a proxy, in a fashion.
User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

Post by voltrader »

it's a cheap server, and I believe fopen wrappers are disabled... any other method?
User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

Post by voltrader »

got it feyd... thanks. I'll experiment.

Argh. The popular anon proxies are also blocked by my mate's IT guys, so i'll have to build a rudimentary one myself.

I suppose I should change all the img src=... references as a start.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

href, src, action, background.. if you want to make a real good one, there's a lot to switch, but for the most part, those are all you need to fix..
Post Reply