Curl Proxy

Started on the old forum in April 2011 · view the original in the archive · old links redirect here

#curl #proxy

14 replies · 1,527 views · started 15 years ago · 1 min read

9 participants
soul_reaper Developer · 83 posts #1

Hello 😀 i have 1 problem :-? how to use curl with proxy ? :-? i want to use another ip not mine (server ip)

i try something like that but doesn`t work :-?

<?php
$proxy = ""; //<-optional proxy IP
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://site.com'); 
curl_setopt($ch, CURLOPT_HEADER, 1); 
if($proxy){
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); 
curl_setopt($ch, CURLOPT_PROXY, "$proxy"); 
}
$data = curl_exec($ch); 
curl_close($ch); 
?>

you know another code/way to do that ? :-?

The LORD is my shepherd, i shall not be in want. He makes me lie down in green pastures, he leads me beside quiet waters, he restore my soul. He guides me in path of righteousness for his name's sake. Even though i walk through the valley of shadow of death, i will fear no evil for you are with me.

GumSlone Administrator Principal · 1,690 posts #2

soul_reaper wrote: Hello 😀 i have 1 problem :-? how to use curl with proxy ? :-? i want to use another ip not mine (server ip)

i try something like that but doesn`t work :-?

<?php
$proxy = ""; //<-optional proxy IP
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://site.com'); 
curl_setopt($ch, CURLOPT_HEADER, 1); 
if($proxy){
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); 
curl_setopt($ch, CURLOPT_PROXY, "$proxy"); 
}
$data = curl_exec($ch); 
curl_close($ch); 
?>

you know another code/way to do that ? :-?

and what is not working in your code? curl will have always the server ip.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

soul_reaper Developer · 83 posts #3

GumSlone

i don`t know :-? that i ask...he show blank page :-? but if i set curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, o); it works :|

and i have one more question :-? can i change range ip ? :-? not only last numbers for last numbers i use curl_setopt ($ch, CURLOPT_INTERFACE, 'your ip'); and ip i get from cpanel/your list ip but i want to set an external ip ,not mine :| i don`t know if you understand

The LORD is my shepherd, i shall not be in want. He makes me lie down in green pastures, he leads me beside quiet waters, he restore my soul. He guides me in path of righteousness for his name's sake. Even though i walk through the valley of shadow of death, i will fear no evil for you are with me.

soul_reaper Developer · 83 posts #5

ViCkSy

yes 😀

The LORD is my shepherd, i shall not be in want. He makes me lie down in green pastures, he leads me beside quiet waters, he restore my soul. He guides me in path of righteousness for his name's sake. Even though i walk through the valley of shadow of death, i will fear no evil for you are with me.

GumSlone Administrator Principal · 1,690 posts #7

soul_reaper wrote: GumSlone

i don`t know :-? that i ask...he show blank page :-? but if i set curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, o); it works :|

and i have one more question :-? can i change range ip ? :-? not only last numbers for last numbers i use curl_setopt ($ch, CURLOPT_INTERFACE, 'your ip'); and ip i get from cpanel/your list ip but i want to set an external ip ,not mine :| i don`t know if you understand

the curl connection will have the ip of the server from which you connect, your sites ip.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

coangcoet Junior · 16 posts #8

how to create proxy php code with random useragent and ip addres,?

Mysterio Lead · 630 posts #9

coangcoet wrote: how to create proxy php code with random useragent and ip addres,?

There are many proxy scripts on internet, which are free and/or open source, but I am not finding any to work as I expect.

mysterio.al - programming is a functional art

Coolatmusic Newbie · 8 posts #12

i also need a similar script........

i m creating a grabber for which i need to verify the user agent of the script as a mobile browser

Latest Stuff Only On http://redmaza.tk

BioBeo Developer · 67 posts #13

GumSlone wrote: the curl connection will have the ip of the server from which you connect, your sites ip.

I would like to access google voice with this.. cause in my country google voice is not available...

can you make a script to access google.com/voice with US ip ?

No one could help you If you don't help yourself. My facebook

kei_ki7 Senior · 431 posts #14

BioBeo wrote: I would like to access google voice with this.. cause in my country google voice is not available...

can you make a script to access google.com/voice with US ip ?

Try to use VPN

Did I help you? You can help me too Your donations will help me finance my studies.

coangcoet Junior · 16 posts #15

how to grab web proxy example dartspeed.info

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close