Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fsockopen FROM a specific IP

Status
Not open for further replies.

JavaTurkey

Technical User
Dec 24, 2001
42
US
Hi - due to my firewall, I have a box with 2 ip's on it. Sometimes I need to setup a connection through fsockopen from ONE ip, and sometimes I need it to connect through the other. i'd like to specify in the script from what IP it connects, if possible. Thanks-
 
I doubt there's a way to do it using PHP native functions.

I think the least-effort solution will be to change your routing tables so that a particular IP address is the preferred route to the destination address. The route will have to be changed through the invocation of OS-specific routing table manipulation tools.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Yeah, unfortunately that won't work in this case...I just wish I knew how PHP decides from what IP to open a connection. Anyone know? Thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top