현재 보는 책은 '제대로 배우는 NodeJS'
메모하고자 하는 것은 색인을 위한 문장
페이지 150p.
./node-http-proxy --port 8000 --tartget localhost:8124
페이지 151p.
코드를 이용해서 port proxy 사용
uri값에 따라 port분기함
if req.url.match( /^\/node\// ) proxy.proxyRequest( req, res, { host : 'localhost', port : 8000 });
else proxy.proxyRequest( req, res, { host : 'localhost', port : 8124 });
이게 된다는 거임..
그래서 URL을 아래같이 요청하면 프록시에서 분기시킴
/node/123 -> localhost:8000
/example.html -> localhost:8124
/node/567 -> localhost:8000
/htmltest/wow123 -> localhost:8124
^^; 색인용으로 간단히 메모만 함.
'서버 > NodeJS' 카테고리의 다른 글
[NODEJS] chatting server git source (0) | 2013.10.23 |
---|---|
[NodeJS] Express를 MVC로 활용 (0) | 2013.08.27 |
[NodeJS] 패키지로 설치하기 (0) | 2013.08.25 |
[NodeJS] node.js 앱의 인스턴스를 관리해 주는 forever (0) | 2013.08.21 |
[NodeJS] Webserver 셋팅 (0) | 2013.08.21 |