cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using 'fiori-tools-proxy' behind a corporate proxy not working properly

0 Kudos
4,980

Hi everybody,

currently, the middleware 'fiori-tools-proxy' of @sap/ux-ui5-tooling cannot be used behind an enterprise proxy if the backend is located in the enterprise network and the npm proxy config (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) is set.

The error is located in the "isHostExcludedFromProxy" function. Here it is checked whether the coporate proxy is necessary for the URL set in UI5.yaml.

In line 107906 a JavaScript URL instance is created from the passed string url (e.g. "https://www.sap.com:443") After that the property "host" is selected from the created instance. However, the host from the URL object is set with port.

So the endsWith() check in line 107908 is always performed against HOST:PORT. Usually the NO_PROXY environment variable is not set with port, but only the domain is specified. As a result, the function returns 'false' and the proxy is wrongly set for the internal URL.

Workaround, so that it works anyway:

1. Delete environment variable (HTTP_PROXY, HTTPS_PROXY, NO_PROXY). NPM with default registry will not work anymore.

2. Add NO_PROXY entry with PORT (*.sap.com:443)

Accepted Solutions (1)

Accepted Solutions (1)

zdravko_georgiev
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello niklas.weissenfels,

thank you for bringing this to our attention. A GitHub issue was created for this issue https://github.com/SAP/open-ux-tools/issues/722.

Best regards,

Zdravko

Answers (4)

Answers (4)

zdravko_georgiev
Product and Topic Expert
Product and Topic Expert

Hi niklas.weissenfels,

a new version of @sap/ux-ui5-tooling was released. The new version 1.8.0 contains the fix for the corporate proxy issue.

Best regards,

Zdravko

0 Kudos

hi @zdravko_georgiev ,

I'm facing the proxy problem but with different errors. 
Nodejs version: 20

ux-ui5-tooling version: "^1.12.3"

TypeError: res.status is not a function

    at setHtmlResponse (/Users/c5345450/SAPDevelop/hc-portal/app/node_modules/@sap/ux-ui5-tooling/dist/middlewares/fiori-tools-proxy.js:178006:9)

    at injectScripts (/Users/c5345450/SAPDevelop/hc-portal/app/node_modules/@sap/ux-ui5-tooling/dist/middlewares/fiori-tools-proxy.js:178142:7)

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

    at async /Users/c5345450/SAPDevelop/hc-portal/app/node_modules/@sap/ux-ui5-tooling/dist/middlewares/fiori-tools-proxy.js:178283:5

 

zdravko_georgiev
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi @Manivel_Manoharan, could you please try with Node.js version and latest (1.14.3) version of @Sisn/ux-ui5-tooling?
SchmidM
Explorer
0 Kudos

Hi niklas.weissenfels,

we are facing the same problem and we are not quite sure, if we have syntactically the correct settings. Could you please post you config ?

Thanks in advance.

Max

jainkapil1
Explorer
0 Kudos

Hi Zdravko,

I am also getting the error -

TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"

at new NodeError (node:internal/errors:399:5)

at new ClientRequest (node:_http_client:189:11)

at Object.request (node:https:360:10)

at Array.stream (C:\Users\pkja006\workspaceepri\project2\node_modules\@sap\ux-ui5-tooling\dist\middlewares\fiori-tools-proxy.js:59033:74)

at ProxyServer.<anonymous> (C:\Users\pkja006\workspaceepri\project2\node_modules\@sap\ux-ui5-tooling\dist\middlewares\fiori-tools-proxy.js:58796:21)

at HttpProxyMiddleware.<anonymous> (C:\Users\pkja006\workspaceepri\project2\node_modules\@sap\ux-ui5-tooling\dist\middlewares\fiori-tools-proxy.js:57898:32)

Could you please wth it?

Best Regads,

Kapil

zdravko_georgiev
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello jainkapil27,

could you please which version of "@sap/ux-ui5-tooling" is installed in your project?

Best regards,

Zdravko