Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member medlington's Avatar
    Join Date
    Nov 2005
    Location
    Sheffield, UK
    Posts
    377
    Member #
    11968
    Liked
    4 times
    Hi,

    I've been given password protected access to an XML feed and to gain access I had to provide the company with my IP address. I gave them the IP address of my server as I will be running a script on there that will require access to this feed.

    Now the problem I have is that I cant even view the feed from my browser as my computers using a different IP which is not static.

    Im not sure how to proceed with this as if I give them my computer IP address it will change and I will continually have to keep updating it with them but I need to view the feed to figure out how to process it.

    My theory is that I can install a proxy server on my server and then connect to the feed through that and it will then be using the server IP which I have given them.

    I tried installing glype on my server and it seems to work ok but when I do a 'whats my ip' on it, its giving me a different IP address.

    Does anyone know of any software which I can use that will let me speciy the IP address that the proxy will show itself as? or does anyone know if this will even work?

    Thanks

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    You don't need a proxy...

    You need to create a script to call the feed from you server and save a copy to the server.

    Even if you are successful in setting up a proxy, firewalls can and do detect the pass through request and block them. Way too much effort for an XML feed. If you're on a Linux server, schedule your script to run as a from job then save a copy to your server... Then use the copy for everyone else

  4. #3
    Senior Member medlington's Avatar
    Join Date
    Nov 2005
    Location
    Sheffield, UK
    Posts
    377
    Member #
    11968
    Liked
    4 times
    Ah I see. So I can just get it to save the xml so that I can create the script to manipulate it and then I can base all of my coding on working with the saved XML file rather than directly from the feed. I can then just run the script to update the xml file every hour or so.

    Cheers!

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    That's the way I do it... But I use ASP and a windows scheduler to call the file, pull it, then save it to a folder that users can see... Depending on the feed... Ad what its used for... An hour is fine.. I have some I update every 5 minutes...

  6. #5
    Senior Member medlington's Avatar
    Join Date
    Nov 2005
    Location
    Sheffield, UK
    Posts
    377
    Member #
    11968
    Liked
    4 times
    5 Mins may be better for me in the end as its a gambling odds feed that is liable to change rather quickly.

    I've tried using this code to grab the file but I keep getting a forbidden error, can you see any problems with it:

    Code:
    <?
    /**
     * Initialize the cURL session
     */
     $ch = curl_init();
    
     /**
     * Set the URL of the page or file to download.
     */
     $username = "username";
     $password = "password";
     
     curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
     curl_setopt($ch, CURLOPT_URL, 'http://xml.paddypower.com/serv2/soccer.xml');
     curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
     /**
     * Create a new file
     */
     $fp = fopen('rss.xml', 'w');
    
     /**
     * Ask cURL to write the contents to a file
     */
     curl_setopt($ch, CURLOPT_FILE, $fp);
    
     /**
     * Execute the cURL session
     */
     curl_exec ($ch);
    
     /**
     * Close cURL session and file
     */
     curl_close ($ch);
     fclose($fp);
     
     ?>
    The same script grabs the google RSS feed no problem but I think there must be some authentication issue. Do all servers accept cURL requests and are there any other ways of grabbing a password protected file other than cURL?

    Thanks

  7. #6
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Depends on the authentication model they are using and or allowing you to connect with ?

    Your best bet would be to ask the people providing access, what authentication they are supporting ?

    Since its across domains, you'll more than likely need to provide domain login credentials... What you're currently using would work on the same server ( assumption the request is coming from the same domain ).


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com