angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Proxy not working when running ng serve

Open mackelito opened this issue 9 years ago • 24 comments

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.json This 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.. ?

mackelito avatar Feb 13 '17 21:02 mackelito

@kultigin trying add the below to avoid ECONNRESET error { "/emport-api/*": { "target": "http://localhost:8080", "secure": false, "logLevel": "debug", "changeOrigin": true, "headers": { "Connection": "keep-alive" } } }

nikithaperuka89 avatar Mar 21 '19 15:03 nikithaperuka89

Yes sorry I have found and done this fix
"Connection": "keep-alive" which fixed my issue. Didn't update this page sorry. Thanks for posting.

kultigin avatar May 16 '19 11:05 kultigin

proxy.conf.js does not exist. Please help me out for this issue

rakesh2293 avatar Aug 11 '19 03:08 rakesh2293

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.