Skip to content
Server
2013.04.20 08:08

PHP Proxy 가져오기

조회 수 14181 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

 

<?
$proxy_user = 'Michiel';
$proxy_pass = 'mypassword';
$proxy_url = 'myproxyurl:port';
$proxy = true;

$service_url = "https://www.myapiurltocall.com";
$service_user = 'user:password:FO';
$service_pass = 'password';

$ch = curl_init($service_url);

// Set proxy if necessary
if ($proxy) {
    curl_setopt($ch, CURLOPT_PROXY, $proxy_url);
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy_user.':'.$proxy_pass);
    curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
    curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
}

// Set service authentication
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_USERPWD, "{$service_user}:{$service_pass}");

// HTTP headers
$headers['Authorization'] = 'Basic ' . base64_encode("$proxy_user:$proxy_pass");

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);   
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_TIMEOUT, 15);

//WARNING: this would prevent curl from detecting a 'man in the middle' attack
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);
?>

 

웹프록시 리스트 : http://incloak.com/proxy-list/?maxtime=500&type=h

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
637 컴퓨터잡담 IE 훅킹 혹은 가로채기. 강좌 2 2011.12.17 14604
636 컴퓨터잡담 [엑셀] SUMPRODUCT 함수 이용, 조건에 따른 중복항목 제외 후 카운트하는 함수 3 2010.10.09 14583
635 AutoHotKey 웹페이지의 내용을 변수에 넣기 2011.02.17 14493
634 프로세스 불필요한 프로그램을 한번에 삭제하자 - PC Decrapifier 12 2012.05.14 14466
633 컴퓨터잡담 익스플로러9 사용시 화면 멈춤현상 개선방법 1 2011.04.12 14443
632 컴퓨터잡담 GfxUI.exe 오류 발생시 긴급조치 / 화면깨짐현상 등 2 file 2012.10.16 14425
631 컴퓨터잡담 서비스팩3 설치 후 Client Session manager 문제, SM00905 오류 해결방법 1 2 2010.11.01 14407
630 AutoHotKey autohotkey) 런처시스템 3 2012.05.30 14286
629 컴퓨터잡담 php 이미지 저장 및 이미지크기를 줄여 저장기술 소스 2009.10.17 14232
628 컴퓨터잡담 [윈도우proxy server]프록시 서버 구축하기 file 2011.09.06 14204
627 컴퓨터잡담 Ahk Standard Library Collection, 2010 Sep (+Gui) ~ Libs: 100 3 2011.10.11 14190
» Server PHP Proxy 가져오기 2 2013.04.20 14181
625 Excel 배열수식 다중조건의 일치하는 값 불러 오기 2014.08.20 14176
624 Excel 엑셀 주소참조 - Get.Cell(type_num, reference) 3 2012.04.23 14172
623 컴퓨터잡담 APMSetup에서 문서 출력 순서 등 설정 2010.07.07 14066
622 컴퓨터잡담 mysqladmin 3 2009.11.19 14065
621 Server 아파치 성능테스트 프로그램 1 file 2013.04.03 14034
620 컴퓨터잡담 [악성코드퇴치] hosts 파일로 경로납치 현상 방지 1 2010.08.12 14026
619 컴퓨터잡담 ExCEL VBA) 함수만들기 1 2011.09.25 13998
618 프로세스 rundll32.exe와 svchost.exe 6 2011.02.06 13996
Board Pagination Prev 1 ... 13 14 15 16 17 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소