CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Requesting comment from PHP developers, especially if they directly use hosting..

    Hi all

    Following the introduction of some fairly restrictive internet controlling on one of the networks i use, I'm considering ways to circumvent it..

    I have the ability to create a local proxy that will forward requests to a server-side page, that will fetch the data for me.

    In concept it might be similar to http://www.jmarshall.com/tools/cgiproxy/
    with the exception that i'd establish persistent connections, and not cook the data - the client app is responsible for using the proxy

    I have some questions on this, mainly from a connectivity point of view, and some because i;ve never used php..

    I guess you could describe it as a proxy that works like an ftp server, capable of serving all of the internet. One control channel causes the hosted page to fetch internet data and relay it back. The control channel communication and reception of relayed data is handled entirely by the client machine (operating something like a socks proxy, or a tcp-layer rewriting firewall itself)

    Has anyone successfully connected out to an external resource, from their php pages? (I.e. your hosting account lets your php pages download data from other sites)
    Did you have to buy something specific from the provider to enable this functionality?
    Who decides on the persistence of the connections to the page? Will the host kill the control connection after a while?
    How much work (in php) would this be?


    End of the day, if the hosting package i would need to enable this functionality would be a $10 a month and i can wangle a broadband connection into the office for my own personal use for $12, then i'll buy the broadband, but right now i dont think thats an option and all the paid-for proxy services seem quite pricey ($50+/mo)
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Requesting comment from PHP developers, especially if they directly use hosting..

    From what I understand, you want to use a web server (that you are allowed access to) to connect to another web server (that you don't have access to) in order to show the non-accessible pages? If this is the case, you can read pages from other web sites and then just echo the content. You would have to parse the data in order to correct the links and images.

    Take a look at the following.
    file_get_contents()
    fread()
    fgets()

    In order to parse the data, you might have to dip into regular expressions.

    If this does not answer your questions, could you help me to understand better?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Requesting comment from PHP developers, especially if they directly use hosting..

    Quote Originally Posted by cjard
    Hi all

    Following the introduction of some fairly restrictive internet controlling on one of the networks i use, I'm considering ways to circumvent it..

    I have the ability to create a local proxy that will forward requests to a server-side page, that will fetch the data for me.

    In concept it might be similar to http://www.jmarshall.com/tools/cgiproxy/
    with the exception that i'd establish persistent connections, and not cook the data - the client app is responsible for using the proxy

    I have some questions on this, mainly from a connectivity point of view, and some because i;ve never used php..

    I guess you could describe it as a proxy that works like an ftp server, capable of serving all of the internet. One control channel causes the hosted page to fetch internet data and relay it back. The control channel communication and reception of relayed data is handled entirely by the client machine (operating something like a socks proxy, or a tcp-layer rewriting firewall itself)

    Has anyone successfully connected out to an external resource, from their php pages? (I.e. your hosting account lets your php pages download data from other sites)
    Did you have to buy something specific from the provider to enable this functionality?
    Who decides on the persistence of the connections to the page? Will the host kill the control connection after a while?
    How much work (in php) would this be?


    End of the day, if the hosting package i would need to enable this functionality would be a $10 a month and i can wangle a broadband connection into the office for my own personal use for $12, then i'll buy the broadband, but right now i dont think thats an option and all the paid-for proxy services seem quite pricey ($50+/mo)
    At your own risk of course (many companies don't like their employees circumventing their security policies). Creating an open proxy is a very bad idea, this is in effect what you will be doing, at the very least it should be password protected and use SSL.

    The safest method however is as follows. If you have a broadband connection, simply install a proxy sever on your home LAN which is accessible only from within the LAN. Then use a protocol such as SSH (with a tunnel - I wrote a tutorial for this), or remote desktop to access the LAN and use the proxy server.
    Last edited by visualAd; February 15th, 2007 at 11:44 AM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured