Comments (4)
Oh, I've just realised that I think the HTTP tunnel method would be largely useless since for HTTPS requests the proxy would just be transparently forwarding encrypted HTTPS traffic and thus would not be able to cache any content.
from loopback-next.
I also vote for a feature request. Thank you, appreciate you trying to help out
from loopback-next.
I believe it's not a bug but rather a feature that this library doesn't (yet?) support. There's different methods to proxy HTTP requests, it can be done using the HTTP method CONNECT (https://en.wikipedia.org/wiki/HTTP_tunnel) or it can be done by supplying the full url instead of just a path in the HTTP request (https://en.wikipedia.org/wiki/Proxy_server#Web_proxy_servers). It seems this library supports the latter method but not the former.
# Start the proxy server
node -e 'const {HttpCachingProxy} = require("@loopback/http-caching-proxy"); const proxy = new HttpCachingProxy({cachePath: "/tmp/.proxy-cache", port: 3000}); proxy.start().then(() => console.log(`Proxy started at ${proxy.url}`))'
# Send a request
curl -v --request-target 'https://worldtimeapi.org/api/timezone/Asia/Jerusalem' -H "Host: worldtimeapi.org" http://localhost:3000
Personally I'd love to see this library support the HTTP tunnel proxy method (that's what I was looking for when I came across this library) so maybe this ticket can be turned from a bug ticket into a feature request?
from loopback-next.
@elyran I came up with an ugly workaround which may or may not work in your situation. It's detailed in the snippets of code at the end of this post: apify/got-scraping#140 (comment)
from loopback-next.
Related Issues (20)
- [@loopback/sequelize] Scope setting on Loopback Model is ignored by Sequelize extension
- @loopback/rest - v13.1.3 request validation fails
- [@loopback/sequelize] Test sandbox directory is included in the published NPM package
- [@loopback/sequelize] Typescript error when using the "required" property with Sequelize HOT 2
- Polymorphic relations broke SQL Transactions HOT 5
- Error when running `npm run tsdocs`
- @loopback/repository 6.1.4 broke hasManyThrough relations HOT 4
- [@loopback/sequelize] contains & match (extendedOperators) are not working HOT 1
- [@loopback/sequelize] SQL select error if an empty string "order" is passed to SequelizeRepository find / findOne methods
- Options param in SequelizeRepository create methods issue HOT 2
- ESLint: naming convention errors on certain third-party imports
- @loopback/sequelize:modify the regular expression to match a select query with parentheses
- Dockerfile improvements HOT 3
- [BOOT] Not possible to import ESM project files HOT 2
- [@loopback/sequelize] Unable to order by associations using "order" filter
- [@loopback/sequelize] syncSequelizeModel error for models having property type array & item-type object HOT 3
- lb4 controller fails with type BASIC HOT 2
- [@loopback/sequelize] Hidden properties configuration is not applied to nested model relations
- Loopback/rest stringifies the responce which takes time and hangs the app HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loopback-next.