简体   繁体   中英

Angular - How to set corporate proxy for http request

Suppose my corporate proxy - >> http://proxy.comapny.com:8080 and Http url - >> http://15.232.2.216/api/get/data?elm=STATE (local network ip adderss) angular running on my ip - >> http://15.232.1.178:4200

http url ip address is changed depending on url input so not a solution to set proxy as ip address in proxy.config.json and run command ng serve --proxy-config proxy.config.js like

 "*/api" : {
        "target" : "http://15.232.2.216",
        "secure" : false,
        "changeOrigin": true
    } 

What is solution on above problem.

First with the help of your corporate network team assign static ip to your system. So IP won't change and you can use that url for setting up a proxy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM