0

Possible Duplicate:
Specify source ip using fsockopen

I have a VPS that have a couple of IP addresses. I want it to connect to a website like a proxy to acquire the website. The script is working perfectly but I need it to use the different IP addresses that I have to connect to different sites since the websites have set so that some of the IP addresses can only get certain amounts of data.

Example:
IP1 connect to site1 and gets data1
IP2 connect to site1 and gets data2
IP3 connect to site1 and gets data3

Is this possible?

Community
  • 1
  • 1
Emil Hemdal
  • 589
  • 2
  • 8
  • 27
  • Sounds shady. Are you sure you aren't violating the terms of use of the receiving website/server? – Madara's Ghost Nov 29 '12 at 15:30
  • Why should that not be possible? Where is the problem? Make one request for each address and you have the data you want. Probably it would be much easier to use cURL instead of a raw socket. – arkascha Nov 29 '12 at 15:33
  • Ah wait, you are talking about the _client_ (your server acting as a client) making the request from different ip addresses? – arkascha Nov 29 '12 at 15:36
  • @MadaraUchiha Yes I'm sure. The proxy is going to be used by library users for remote access to resources (EBSCO, PubMed, ScienceDirect, etc.) But it's going to be used by many different libraries that have different licenses for the resources. The resources can be set to auto login for ip addresses. – Emil Hemdal Nov 29 '12 at 15:37
  • @arkascha Yes. The server is acting as the client then sends the webpage to the client using the proxy. – Emil Hemdal Nov 29 '12 at 15:39
  • 1
    May this helps? http://blog.nachtarbeiter.net/2008/08/21/binding-phps-fsockopen-to-a-specific-ip-address/ – arkascha Nov 29 '12 at 15:40
  • @emilhem Sorry, can't follow there: if the server is acting as a client, why does it _send_ the web page? And I guess you have to explain more about that proxy. I though your meant _like_ a proxy, but apparently you refer to an existing proxy? – arkascha Nov 29 '12 at 15:41
  • @arkascha Sorry for the confusion. The user requests a resource after logging in to the website. The website then uses one of the IP's to proxy the "connection" (destination website) to the user. I hope that it's more clear now. – Emil Hemdal Nov 29 '12 at 17:43
  • Ok, then the original idea was right. Both links offered above give examples of ho to use the socket functions to do what you want. You checked them? – arkascha Nov 29 '12 at 17:55

0 Answers0