[devon 2013] dynamic web proxy
TRANSCRIPT
![Page 1: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/1.jpg)
Dynamic Web Proxy
어떻게 구현하나요 ?JavaCafe
김흥래
자바카페 OPEN 세미나 in DevOn 2013
![Page 3: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/3.jpg)
Proxy Overview
![Page 4: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/4.jpg)
![Page 5: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/5.jpg)
![Page 6: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/6.jpg)
![Page 7: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/7.jpg)
Proxy 를 어디에 사용할까 ?
• Web Server 앞쪽 Cache 용도 (Web Cache)
• 서비스의 접근 정책 적용 ( 사이트 차단 )• 네트워크 Access 로깅
• 다른 정보를 빼낼 목적• IP 추적을 피할 목적• 지역 구분을 회피 할 목적
![Page 8: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/8.jpg)
Proxy 의 두가지 측면 ?
![Page 9: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/9.jpg)
Proxy 를 어디에 사용할까 ?
• Web Server 앞쪽 Cache 용도 (Web Cache)
• 서비스의 접근 정책 적용 ( 사이트 차단 )• 네트워크 Access 로깅
• 다른 정보를 빼낼 목적• IP 추적을 피할 목적• 지역 구분을 회피 할 목적
![Page 10: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/10.jpg)
![Page 11: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/11.jpg)
![Page 12: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/12.jpg)
Proxy 를 어디에 사용할까 ?
• Web Server 앞쪽 Cache 용도 (Web Cache)
• 서비스의 접근 정책 적용 ( 사이트 차단 )• 네트워크 Access 로깅
• 다른 정보를 빼낼 목적• IP 추적을 피할 목적• 지역 구분을 회피 할 목적
![Page 13: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/13.jpg)
![Page 14: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/14.jpg)
![Page 15: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/15.jpg)
![Page 16: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/16.jpg)
![Page 17: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/17.jpg)
Proxy Server
![Page 18: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/18.jpg)
Forward Proxy Server
![Page 19: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/19.jpg)
Reverse Proxy Server
![Page 20: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/20.jpg)
Open Proxy Server
![Page 21: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/21.jpg)
Web Proxy
![Page 22: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/22.jpg)
Web Proxy (Http Proxy)
![Page 23: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/23.jpg)
Http Security Proxy
![Page 24: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/24.jpg)
API Gateway
![Page 25: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/25.jpg)
API Gateway
![Page 26: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/26.jpg)
API Gateway
![Page 27: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/27.jpg)
Web Proxy ?
Web Browser ?
![Page 28: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/28.jpg)
Web Browser
![Page 29: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/29.jpg)
Web Proxy
![Page 30: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/30.jpg)
Http ProxyInternal
![Page 31: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/31.jpg)
Basic Http Proxy
• URLConnection• JDK 기본 API• java.net.HttpURLConnection• Since : JDK 1.1
![Page 32: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/32.jpg)
Basic Http Proxy
![Page 33: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/33.jpg)
Advanced Http Proxy
![Page 34: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/34.jpg)
![Page 35: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/35.jpg)
Apache Http Compo-nents• Http Protocol 통신을 지원하는 자바 기반의 Com-
ponent
• Http 기반의 클라이언트 및 서버 프로그램 개발 가능
HttpClient, HttpCore 라이브러리로 구성
• 2001 년부터 개발되기 시작한 안정화 된 라이브러리
• Apache Commons 프로젝트에서 독립 프로젝트로
승격
![Page 36: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/36.jpg)
![Page 37: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/37.jpg)
![Page 38: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/38.jpg)
![Page 39: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/39.jpg)
![Page 40: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/40.jpg)
![Page 41: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/41.jpg)
Apache Http Compo-nents• HttpComponents Core
• Low Level 의 HTTP 전송 컴포넌트• HTTP 기반의 Server 와 Client 구현 가능• Blocking I/O 와 Non-Blocking I/O 지원
• HttpComponents Client• HttpCore 를 이용하여 구현한 HTTP 기반의 Client• Blocking I/O 기반
• HttpComponents AysncClient• HttpCore NIO 를 이용하여 구현한 HTTP 기반의 Client• Non-Blockin I/O 기반• 현재 Beta 버전임
• Commons HttpClient (legacy)• 과거 3.0 기준의 라이브러리
![Page 42: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/42.jpg)
HTTP Component 는 크게 2 가지의 모듈로 구성되어 있다 .
Http Core
Http Client
![Page 43: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/43.jpg)
HttpCore 라이브러리
• Low Level HTTP 라이브러리• Blocking I/O 기반 기술 제공• Non-Blocking I/O 기반 기술 제공• HTTP 1.1 프로토콜 완벽 지원
![Page 44: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/44.jpg)
HttpCore 라이브러리
• HttpCore• Blocking I/O 기반의 Http 컴포넌트• httpcore-4.2.3.jar
• HttpCore NIO• Non-Blocking I/O 기반의 Http 컴포넌트• httpcore-nio-4.2.3.jar
![Page 45: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/45.jpg)
HttpClient 라이브러리• HttpCore 를 기반으로 만든 Client-Side HTTP
라이브러리• Http 1.1 프로토콜이 지원하는 모든 메소드 구현
(GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE)
• 기본적으로 Blocking I/O 기반의 동작방식을 가진다 . • HTTP 메시지를 전송 및 수신이 가능하다 .• 손쉬운 Http Proxy 구성이 가능하다 .• URI Redirect 동작이나 HTML 랜더링이 불가능하다 .• Javascript 실행이 불가능하다 .• Web Browser 가 아니다 .
![Page 46: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/46.jpg)
HttpClient 라이브러리• HttpClient
• Client-side HTTP 통신 지원• httpclient-4.2.3.jar
• HttpMime• HttpClient 모듈을 지원하기 위한 용도• MIME Encoding• httpmime-4.2.3.jar
• HttpClient Cache• HttpClient 모듈에 Cache 기능을 추가한 확장 모듈• Ehcache, Memcached• httpclient-cache-4.2.3.jar
![Page 47: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/47.jpg)
HttpClient 라이브러리
![Page 48: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/48.jpg)
HttpClient 라이브러리
![Page 49: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/49.jpg)
HttpClient 라이브러리
![Page 50: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/50.jpg)
HttpClient 라이브러리
![Page 51: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/51.jpg)
HttpClient 라이브러리
![Page 52: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/52.jpg)
HttpClient 라이브러리
![Page 53: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/53.jpg)
Http Core
Http Client
![Page 54: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/54.jpg)
![Page 55: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/55.jpg)
![Page 56: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/56.jpg)
![Page 57: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/57.jpg)
DEMO
![Page 58: [DevOn 2013] Dynamic web proxy](https://reader035.vdocuments.pub/reader035/viewer/2022062303/5561ef73d8b42a9d068b55f7/html5/thumbnails/58.jpg)
Thank you자바카페는 언제나 열려있습니다 .