Skip to content

Commit e06b73f

Browse files
Gkleinerevaalxhub
authored andcommitted
docs: add warning for localhost proxy (angular#51948)
PR Close angular#51948
1 parent bdd61c7 commit e06b73f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

aio/content/guide/build.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,19 @@ If you edit the proxy configuration file, you must relaunch the `ng serve` proce
388388

389389
</div>
390390

391+
<div class="alert is-important">
392+
393+
As of Node version 17, Node will not always resolve `http://localhost:<port>` to `http://127.0.0.1:<port>`
394+
depending on each machine's configuration.
395+
396+
If you get an `ECONNREFUSED` error using a proxy targeting a `localhost` URL,
397+
you can fix this issue by updating the target from `http://localhost:<port>` to `http://127.0.0.1:<port>`.
398+
399+
See [the http proxy middleware documentation](https://github.com/chimurai/http-proxy-middleware#nodejs-17-econnrefused-issue-with-ipv6-and-localhost-705)
400+
for more information.
401+
402+
</div>
403+
391404
### Rewrite the URL path
392405

393406
The `pathRewrite` proxy configuration option lets you rewrite the URL path at run time.

0 commit comments

Comments
 (0)