-
Notifications
You must be signed in to change notification settings - Fork 12k
Proxy not working when running ng serve #4676
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
Did you try
? |
It starts but I´m not able to navigate to 192.168.1.207:4200 |
I was kind of hoping that adding something like |
Try using the Like It can also be stored in
|
Worked like a charm!.. thx! :) |
Spoke to soon...
But it works if I run it in the terminal It starts but proxy is not working.. |
I think to do |
We don't support having the I'll accept it as a feature request if someone wants to take it on. Otherwise this is a consideration for 2.0 (having everything customizable in the config file). |
@mackelito I added similar command line( I am using Windows 10, I am not sure if this is a system specific problem. When I used
|
I have added my detailed development environment in issue ##889 (comment) |
fwiw, I could really use this... having a tough time putting authentication in front of serving up our app without a proxy to do it... hate to eject the config. |
@filipesilva also - should this have a "this doesn't work yet" marker somewhere? https://github.com/angular/angular-cli/wiki/stories-proxy I spent a few days trying to get this to work -- I assumed the story doc's meant it was usable...? |
#6493 added support to have the proxy config in @chadbr the story described in https://github.com/angular/angular-cli/wiki/stories-proxy is working, and has been working for a long time, to the best of my knowledge. I have to suppose you did some modifications there. What were they? So the remaining problem is that incoming connections when Ultimately though, you should really check out https://webpack.github.io/docs/webpack-dev-server.html#proxy as the proxy doc suggests (or the newer https://webpack.js.org/configuration/dev-server/#devserver-proxy). We only enable passing on these options, webpack provides the functionality proper. |
@filipesilva - sorry, I misread your comment above --
I thought that meant the feature didn't work :) fwiw, I can't get redirects to work when it goes to a public https host -- but it works great locally. |
Maybe off topic, but I'd greatly appreciate having all the If currently have to use Edit: a note on the port if anyone is curious, we run forward the port 4200 to the external port 14200 since we run several different vagrant machines for various testings. |
Proxy config file /home/user/Documents/workspace-sts-3.8.3.RELEASE/AppCURD/proxy.conf.json does not exist. npm ERR! A complete log of this run can be found in: |
Here is my working code:
|
I am facing a problem with my app when trying to hit a backend server which is on https with invalid certificate. The following is my proxy.conf.json. {
"/api": {
"target": "https://www.dev.xxxxxx.au",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
} This is working fine for GET request, but when I tried POST I am getting the following
If "pathRewrite": {
"^/api": ""
} but with no luck. Stuck on this since a day.. Any ideas??? |
All right, friends, what worked for me is strangely enough changing the backend port from 3000 to 3001. Not sure what's so special about 3000, but I've noticed it was used in all posts of people experiencing the problem. Changing it to 3001 fixed the problem for me. |
This is an on going issue for me. And very annoying. I have most of the api calls running but sometimes the application doesn't even start because of ECONNRESET. I select one user account and I get details for it, when I select another user account it fails to load. So it is mostly unpredictable.Linux people running same code same ng-serve do not have this issue by the way. I am on MAC OSX that should say something too. Port changing didn't work for me our api is on localhost:8080 it is all used in development. |
@kultigin trying add the below to avoid ECONNRESET error |
Yes sorry I have found and done this fix |
proxy.conf.js does not exist. |
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?
Mac OSX (Sierra)
Versions.
@angular/cli: 1.0.0-beta.31
node --version v6.9.1
Repro steps.
Need to run a proxy so I added
--proxy-config proxy.conf.json
in package.jsonThis works if I run
npm start
but then I cant access the site from my mobile on the same network.If I run
ng serve
then I can use my mobile to test the site but the proxy stopps working.. ?The text was updated successfully, but these errors were encountered: