Jump to content


Photo

PHP script+proxy ip address


  • Please log in to reply
1 reply to this topic

#1 spandauforum

spandauforum
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 July 2005 - 04:17 AM

is there a php function, wherein i can set a proxy ip address to be used, in order

to run my php script?

#2 Britz

Britz
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 24 October 2005 - 12:43 PM

i had same problem not 2 long ago
i read the manual and figured it out

http://www.php.net/m...appers.http.php
http://www.php.net/m...text-create.php
http://www.php.net/m...ction.fopen.php

if you look at those 3 pages from the manual you can form this example:

at the same time i was looking how to connect through proxy i was looking how to send a cookie aswell so if you want cookie its in example also
<?php
$contextz['http']['proxy'] = "tcp://localhost:5865";
$contextz['http']['header'] = "Cookie: bla=123"; //if you want you can throw some cookies this way
$contextz = stream_context_create($contextz);
$filehandle = fopen("http://localhost/index.php", "r", false, $contextz);
?>
and there you are enjoy. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users