Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui5-middleware-simpleproxy] How could i use this package behind a company proxy server #748

Closed
zouyi100 opened this issue May 29, 2023 · 2 comments · Fixed by #818
Closed

Comments

@zouyi100
Copy link

Hi Team,
Now i'm working in a network hehind a proxy server. Now i want to send the req to Northwind OData serve, config like below:

server:
  customMiddleware:
  - name: ui5-middleware-simpleproxy
    mountPath: /Northwind/v2/northwind/northwind.svc/
    afterMiddleware: compression
    configuration:
      baseUri: "https://services.odata.org/v2/northwind/northwind.svc"
      path: webapp

Now it still showing like https://services.odata.org/v2/northwind/northwind.svc 404 NOT FOUND.
Because it's like proxy the /northind to the real https:// url. But the real url is not found without the company proxy.

So is it posible for adding some config in this middleware to add a proxy before sending the req to real url.

Thank you :)

@petermuessig
Copy link
Member

Hi @zouyi100 ,

looks like a missing feature - just checked the express-http-proxy issues and found the following hint:
villadora/express-http-proxy#337 (comment)

Can you try this by patching the simpleproxy in your node modules? If it works we can think of enhancing the middleware.

petermuessig added a commit that referenced this issue Aug 31, 2023
The `ui5-middleware-cfdestination` and `ui5-middleware-simpleproxy`
are now using the `http-proxy-middleware` instead of the former
`express-http-proxy` to support the following features:

* Support for corporate proxy using env variables (see more details
https://www.npmjs.com/package/proxy-from-env#environment-variables)
* Support redirects using the `autoRewrite` option to handle UAA
* Preparation for websocket support to be able to proxy websocket
requrests (#557)
* Get rid of deprecated `_headers` call due to `express-http-proxy`
* Improved test-cases for the `cfdestination` middleware
* Added test-cases for the `simpleproxy` middleware
* Script to generate self-signed certificates automatically added

Fixes #748 - corporate proxy issue
Fixes #817 - UAA issues
Fixes #816 - deprecated `_headers` call
petermuessig added a commit that referenced this issue Aug 31, 2023
The `ui5-middleware-cfdestination` and `ui5-middleware-simpleproxy`
are now using the `http-proxy-middleware` instead of the former
`express-http-proxy` to support the following features:

* Support for corporate proxy using env variables (see more details
https://www.npmjs.com/package/proxy-from-env#environment-variables)
* Support redirects using the `autoRewrite` option to handle UAA
* Preparation for websocket support to be able to proxy websocket
requrests (#557)
* Get rid of deprecated `_headers` call due to `express-http-proxy`
* Improved test-cases for the `cfdestination` middleware
* Added test-cases for the `simpleproxy` middleware
* Script to generate self-signed certificates automatically added

Fixes #748 - corporate proxy issue
Fixes #817 - UAA issues
Fixes #816 - deprecated `_headers` call
petermuessig added a commit that referenced this issue Aug 31, 2023
The `ui5-middleware-cfdestination` and `ui5-middleware-simpleproxy`
are now using the `http-proxy-middleware` instead of the former
`express-http-proxy` to support the following features:

* Support for corporate proxy using env variables (see more details
https://www.npmjs.com/package/proxy-from-env#environment-variables)
* Support redirects using the `autoRewrite` option to handle UAA
* Preparation for websocket support to be able to proxy websocket
requrests (#557)
* Get rid of deprecated `_headers` call due to `express-http-proxy`
* Improved test-cases for the `cfdestination` middleware
* Added test-cases for the `simpleproxy` middleware
* Script to generate self-signed certificates automatically added

Fixes #748 - corporate proxy issue
Fixes #817 - UAA issues
Fixes #816 - deprecated `_headers` call
petermuessig added a commit that referenced this issue Aug 31, 2023
The `ui5-middleware-cfdestination` and `ui5-middleware-simpleproxy`
are now using the `http-proxy-middleware` instead of the former
`express-http-proxy` to support the following features:

* Support for corporate proxy using env variables (see more details
https://www.npmjs.com/package/proxy-from-env#environment-variables)
* Support redirects using the `autoRewrite` option to handle UAA
* Preparation for websocket support to be able to proxy websocket
requrests (#557)
* Get rid of deprecated `_headers` call due to `express-http-proxy`
* Improved test-cases for the `cfdestination` middleware
* Added test-cases for the `simpleproxy` middleware
* Script to generate self-signed certificates automatically added

Fixes #748 - corporate proxy issue
Fixes #817 - UAA issues
Fixes #816 - deprecated `_headers` call
@petermuessig
Copy link
Member

Should be fixed with ui5-middleware-simpleproxy version 3.1.0 which will be released just right now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants