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
번호 분류 제목 날짜 조회 수
917 컴퓨터잡담 호스트 / 서버운영자가 가볼만한 사이트 2011.06.17 5423
916 컴퓨터잡담 현재 쿠키,세션 값 전부 보기 2009.06.30 32614
915 Excel 현재 Excel 파일 이름을 셀에 삽입 2 2012.09.17 24560
914 컴퓨터잡담 해외속도테스트 사이트 speedtest.net 2 2012.01.08 5843
913 Visual C++ 함수와변수 14 2011.01.25 17751
912 파이썬 한우경매낙찰 유튜브 영상의 이미지에서 특정 문자 가져와서 저장하기 2023.09.14 80644
911 컴퓨터잡담 한글프로그램 메뉴-모양-세로쓰기 2009.09.21 15752
910 컴퓨터잡담 한글입력이 안될때(how to hangul ...) file 2021.01.08 2839
909 컴퓨터잡담 한글입력이 안될때 의심해봐야 할 파일 imm32.dll 2011.12.14 5995
908 컴퓨터잡담 한글(hwp) msvcr71.dll 오류 해결방법 1 1 file 2013.01.22 6699
907 컴퓨터잡담 한글 HEX 코드표 1 5 2010.03.17 29535
906 Excel 한 셀에 있는 특정 문자의 갯수 구하기 3 2012.06.19 11244
905 컴퓨터잡담 하드 디스크 드라이브(HDD) 숨기기 3 file 2012.03.14 7330
904 컴퓨터잡담 하드 공유폴더 해제하기 1 2012.03.19 8182
903 컴퓨터잡담 핑테스트(PINGINFOVIEW)와 TCPVIEW file 2017.09.21 2326
902 컴퓨터잡담 핑테스트 프로그램 file 2015.09.01 1060
901 컴퓨터잡담 프린터 내용 파일로 저장하기 doPDF 2012.10.17 4706
900 컴퓨터잡담 프록시 서버 만들기 4 2011.03.16 14952
899 컴퓨터잡담 프로세스 숨기고 복구하기 2010.01.21 7199
898 프로세스 프로세스 2 3 2011.02.07 312176
Board Pagination Prev 1 2 3 4 5 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소