Created by: MathieuTurcotte
Given the following router (URL based),
router: {
"baz.com/taco": "127.0.0.1:8098",
"biz.com": "127.0.0.1:8088/taco"
};
- Requests to baz.com/taco will get proxied to 127.0.0.1:8098/
- Requests to baz.com/taco/hot will get proxied to 127.0.0.1:8098/hot
- Requests to biz.com will get proxied to 127.0.0.1:8088/taco
- Requests to biz.com/foo will get proxied to 127.0.0.1:8088/taco/foo
The behavior is the same for hostname based routers. For example, given the following router (hostname based):
router: {
"biz.com": "127.0.0.1:8013/extra",
"buz.com": "127.0.0.1:8014/mega/extra"
};
- Requests to biz.com/taco will get proxied to 127.0.0.1:8013/extra/taco
- Requests to buz.com/dude will get proxied to 127.0.0.1:8014/mega/extra/dude
- etc.
routing-proxy-test.js contains additional examples.