Собственный прокси на PHP+cURL за 5 минут

На http://www.rucoder.ru нашел интересную информацию по поводу накрутки счетчиков на сайтах и тому подобного. Суть проста — на своем сервере сидит php-скрипт, который «заходит» на нужный сайт, считывает с него страничку и отправляет нам. Для этого дела используется библиотека cURL. Вот простой пример с RuCoder’а:

< ?php
    //Поехали!
    $handle = curl_init();
    //$url - куда путь держим
    curl_setopt($handle, CURLOPT_URL, $url);
    //Возвращаем результат
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
    //Пришли с гугла :D
    curl_setopt($handle, CURLOPT_REFERER, 'http://google.com/');
    //Ходим по редиректам
    curl_setopt($handle, CURLOPT_AUTOREFERER, 1);
    //наш прокси сервер в формате 127.0.0.1:8080
    curl_setopt($handle, CURLOPT_PROXY, $proxy_host);
    //Открываем страничку и пишем всё в переменную
    $data = curl_exec($handle);
    //закрываем сеанс
    curl_close($handle);
 
    echo $data;
?>

Я вот думаю — а что, если написать скрипт, который бы принимал параметры cURL от пользователя? Малюем небольшую формочку с полями «какой сайт посещаем» и «с какого реферера», куда вбиваем необходимые данные и наслаждаемся 🙂

2 237 комментариев

  1. Aw, this was an extremely good post. Spending some time and actual effort to produce a very good article… but
    what can I say… I put things off a whole lot and don’t manage to get anything done.

  2. Very good information. Lucky me I ran across your site
    by chance (stumbleupon). I’ve saved as a favorite for later!

  3. Hi, I do think this is a great website. I stumbledupon it
    😉 I am going to return once again since i have bookmarked
    it. Money and freedom is the greatest way to change, may you be rich
    and continue to help other people.

  4. My relatives always say that I am wasting my time here
    at web, except I know I am getting familiarity every day by reading
    such nice articles.

  5. What’s up i am kavin, its my first occasion to commenting anyplace, when i read this paragraph i thought i could also make comment
    due to this good article.

  6. Record all the movie you’ve saved and presently individual when buying movies.

    You don’t want to steer clear of buying films that you’ve have.
    It is possible to usually just search for a history of your
    acquisitions on the obtain services.

  7. Following the advisable hold stance on YouGov in April, because the valuation regarded
    full fairly full, during the time the polling firm was changing palms at just
    over 51p. Now that figure has risen sharply in subsequent months,
    flirting with levels well above 60p in early July,
    the current market has been taking its toll. Despite the
    gloom on the High Avenue, it could be worthwhile
    investing in the nicely managed retailer. Questor’s mantra over
    the last month or so has been use market falls to buy shares in high quality corporations
    with excessive dividend yields. The shares had been advisable on February 13, 2009, at 435p and they
    are up 58 per cent compared with a FTSE a hundred up 28 per
    cent. There have been huge declines in gross margins which have seen earnings before
    curiosity, tax, depreciation and amortisation (EBITDA) slump by 29 per cent to $229million over
    the identical interval.

  8. I’ve read some good stuff here. Certainly price bookmarking for revisiting.
    I surprise how much effort you place to make this kind of magnificent informative web site.

  9. Have you ever thought about adding a little bit more than just your articles?
    I mean, what you say is fundamental and everything. But imagine if you added some great images or video clips to give your posts more, «pop»!
    Your content is excellent but with images and
    video clips, this blog could definitely be one of the greatest in its niche.
    Terrific blog!

  10. Hi there, I found your site by way of Google while
    searching for a comparable subject, your website got here up, it looks good.
    I have bookmarked it in my google bookmarks.
    Hi there, simply was alert to your blog through Google, and located that it is truly informative.
    I am gonna be careful for brussels. I will appreciate if
    you continue this in future. Numerous folks shall be benefited
    out of your writing. Cheers!

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *