블로그 이미지
Flying Mr.Cheon youGom

Recent Comment»

Recent Post»

Recent Trackback»

« 2024/5 »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31


현재 보는 책은 '제대로 배우는 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


^^; 색인용으로 간단히 메모만 함.



: