Skip to content
Server
2013.04.20 08:08

PHP Proxy 가져오기

조회 수 14180 추천 수 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
번호 분류 제목 날짜 조회 수
777 컴퓨터잡담 크롬에서 플래시 사용하기 2020.11.04 3345
776 컴퓨터잡담 [크롬] 원격 데스크톱 외부접속시 "서버에서 참조를 반환했습니다." 오류 해결법 2019.11.18 11407
775 컴퓨터잡담 [REMIX OS]How to Edit of REMIX OS build.prop? 수정방법 file 2019.11.10 12572
774 컴퓨터잡담 CCTV VIEWEASYV2 file 2019.05.31 4111
773 WindowsTip ISO 파일을 USB에 굽는 방법 [4GB 넘는 ISO 파일 USB에 굽는 방법] 2019.04.13 8021
772 컴퓨터잡담 CPU-Z file 2019.02.23 3823
771 컴퓨터잡담 nVIDIA GTX750Ti 드라이버 file 2019.02.19 6798
770 [Docs]스프레드시트 구글 앱스 스크립트(Google Apps Script) 외부에서 실행하기 2 2019.01.09 7027
769 [Docs]스프레드시트 구글 앱스 스크립트(Google Apps Script) 외부에서 실행하기 2019.01.09 6802
768 컴퓨터잡담 윈도우 PC에서 안드로이드 앱 실행 file 2018.09.25 6189
767 [Docs]스프레드시트 구글캘린더 CSV 파일로 일괄 기록하기 file 2018.08.31 12222
766 컴퓨터잡담 메이플스토리 입력신호범위초과(out of range)에러메세지 해결방법 file 2018.07.26 5771
765 AutoHotKey Autohotkey] 키보드 후킹 테스트 file 2018.07.07 9679
764 컴퓨터잡담 마인크래프트 게임충돌 해결방법 file 2018.07.03 24061
763 AutoHotKey autohotkey command-line 실행시 파라미터 설정 2018.02.14 7216
762 HTMLPHPMSQL 자바스크립트 내가 자주 사용하는 함수모음 2018.02.08 7934
761 HTMLPHPMSQL 자바스크립트 명령어 2018.01.31 12756
760 [Docs]스프레드시트 스프레드시트 autohotkey html gmail 스마트폰 이용하여 핑로스 즉시 알림받기 file 2018.01.25 10576
759 HTMLPHPMSQL javascript만으로 html간 변수값 주고받기 2018.01.25 17336
758 [Docs]스프레드시트 google spreadsheets html form post로 전달받기 file 2018.01.23 6858
Board Pagination Prev 1 ... 6 7 8 9 10 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소