-
Notifications
You must be signed in to change notification settings - Fork 12k
Some https proxy urls failed #4322
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
Comments
I'm pretty certain that this is because the target, jsonbin.org is under https and the proxy isn't being trusted. Without really knowing what I'm talking about, the SSL cert from jsonbin.org isn't trusted in the response/proxy in Angular? I've certainly ruled this out by running a local version of jsonbin over http, and the proxy worked fine. I'm not sure how you'd work around it without having to manually intervene and proxy the request with something like the I don't think this is a bug though, on either angular or jsonbin's side. |
@remy I tried to use var express = require('express');
var proxy = require('http-proxy-middleware');
var app = express();
app.use('/api', proxy({target: 'https://jsonbin.org', changeOrigin: true}));
app.listen(3000); It maybe some problem from webpack or something. I'm not sure. |
This might be a stupid check, but do you have a |
@Meligy here is my |
@remy I finally figured out how this issue happen. Your web server configured SNI SSL which means you can install multiple SSL certified on one IP address. So your website can't accept any domain that are registered on your web server. The webpack dev server need to configure Proxying local virtual hosts in order to keep the hostname on the proxy request to the target server. That's the key point on this issue I met yesterday. So here is the right {
"/**": {
"target": {
"host": "jsonbin.org",
"protocol": "https:",
"port": 443
},
"secure": false,
"changeOrigin": true,
"logLevel": "info"
}
} 😺 |
This doesn't work for me. Using Angular CLI 6.0.8 and NodeJS 8.11.3, I can't get the proxy to send the servername, no matter what I set in the proxy configuration. Any ideas? |
This |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
Repro steps.
git clone https://github.com/doggy8088/angular-cli-https-proxy-error.git
cd angular-cli-https-proxy-error
npm install
npm start
Erroroccured while trying to proxy to: localhost:4200/_/help
.[HPM] Error occurred while trying to proxy request /_/help from localhost:4200 to https://jsonbin.org (EPROTO) (https://nodejs.org/api/errors.html#errors_common_system_errors)
.The log given by the failure.
Some useful details
I tested some https webiste without any proxy request problem. Don't know why I just can't proxy my https request to https://jsonbin.org website. I need to proxy my API request to that domain.
I want to log more detail about the error. I was trying to edit the
node_modules\http-proxy-middleware\lib\index.js
file for Line 145 shown as below to show theerr
message.Here is the error output:
I do can browse all these urls by browser or can send request directly from Postman. It just can't send requests to some https urls from angular-cli proxy feature.
The text was updated successfully, but these errors were encountered: