http-party/node-http-proxy

With "toProxy" the url recieved by the proxy server has a "/" prefix

davidshen84 opened this issue · 3 comments

Hi,

I have a proxy object configured like this.

  "proxy": {
        "/api/": {
          target: "http://local.proxy:9000",
          toProxy: true,
          rewrite: (path: string) => {
            return "https://my.website.com" + path;
          },
          changeOrigin: true,
          secure: false
        },
  }

The requests are routed to my local.proxy:9000 like this.

GET /https://my.website.com/api/UserService/GetUserDetails

According to this test case, this is the expected behaviour. But this does not make any sense. To my best knowledge, all proxy services take requests like this:

GET https://my.website.com/api/UserService/GetUserDetails

All other applications use my proxy like above and they all work fine.

Maybe the toProxy documentation need updating and teach people how to use it? I saw a couple of other issues related to this option.

With more investigation, the issue is probably not related to this proxy.

With more investigation, the issue is probably not related to this proxy.

May I ask how did you solve it in the end?

no...I just don't think this issue is related to this project. So I closed it.