on 2022 Oct 04 4:43 PM
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)
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.