Angular proxy + corporate proxy

主宰稳场 提交于 2020-06-12 13:27:31

问题


I have Angular project with next proxy:

const PROXY_CONFIG = {
  "/teploset": {
    "target": "http://95.1.0.3:8080/",
    "secure": false,
    "bypass": function (req, res, proxyOptions) {

      console.log("1");


    },
    "changeOrigin": true
  }
}

module.exports = PROXY_CONFIG;

I need proxy because of CORS issue when requests go to back-end. Everything works good at home, but problems are at work where we use corporate proxy. So I get next error:

[HPM] Error occurred while trying to proxy request /teploset/login from localhost:4200 (ENETUNREACH)

Any ideas?

来源:https://stackoverflow.com/questions/47055038/angular-proxy-corporate-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!