{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/8360","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/8360/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/8360/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/8360/events","html_url":"https://github.com/angular/angular-cli/issues/8360","id":271291648,"number":8360,"title":"CLI 1.5.0 Live Reload Issues When Using Reverse Proxy","user":{"login":"rart","id":3928341,"avatar_url":"https://avatars0.githubusercontent.com/u/3928341?v=4","gravatar_id":"","url":"https://api.github.com/users/rart","html_url":"https://github.com/rart","followers_url":"https://api.github.com/users/rart/followers","following_url":"https://api.github.com/users/rart/following{/other_user}","gists_url":"https://api.github.com/users/rart/gists{/gist_id}","starred_url":"https://api.github.com/users/rart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rart/subscriptions","organizations_url":"https://api.github.com/users/rart/orgs","repos_url":"https://api.github.com/users/rart/repos","events_url":"https://api.github.com/users/rart/events{/privacy}","received_events_url":"https://api.github.com/users/rart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-05T16:09:08Z","updated_at":"2017-11-06T11:25:29Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION YOUR ISSUE MIGHT BE CLOSED WITHOUT INVESTIGATING\r\n-->\r\n### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n- [x] feature request\r\n```\r\n\r\n### Versions.\r\n<!--\r\nOutput from: `ng --version`.\r\nIf nothing, output from: `node --version` and `npm --version`.\r\n  Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)\r\n-->\r\n```\r\nAngular CLI: 1.5.0\r\nNode: 6.11.2\r\nOS: darwin x64\r\nAngular: 5.0.0\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\n@angular/cdk: 2.0.0-beta.12\r\n@angular/cli: 1.5.0\r\n@angular/material: 2.0.0-beta.12\r\n@angular-devkit/build-optimizer: 0.0.32\r\n@angular-devkit/core: 0.0.20\r\n@angular-devkit/schematics: 0.0.35\r\n@ngtools/json-schema: 1.1.0\r\n@ngtools/webpack: 1.8.0\r\n@schematics/angular: 0.1.0\r\ntypescript: 2.4.2\r\nwebpack: 3.8.1\r\n```\r\n\r\n### Repro steps.\r\n<!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\n\r\nI have a tomcat on port 8080 serving the API the angular app (running  on 4200) feeds from. I have an apache running on port 8888 with a reverse proxy like configured as shown below:\r\n```\r\nProxyRequests On\r\nProxyVia On\r\n\r\nProxyPreserveHost On\r\n\r\n    ProxyPass /app http://localhost:4200/\r\n    ProxyPassReverse /app http://localhost:4200/\r\n\r\n    ProxyPass /guest http://localhost:3000/\r\n    ProxyPassReverse /guest http://localhost:3000/\r\n\r\n    ProxyPass / http://localhost:8080/\r\n    ProxyPassReverse / http://localhost:8080/\r\n```\r\n\r\nEssentially, I have set up to access the angular app on localhost:8888/app. \r\n\r\nPrior to upgrading to Angular 5 and cli 1.5.0 it was all working fine. Now, the live reload stopped working. The rest of the app and processes keep working as expected.\r\n\r\nPrior to upgrading, I ran angular with `ng serve --host=0.0.0.0 --deploy-url=/app/ --base-href=/app`. As mentioned that stopped working and I've tried a number of command/param configurations without success. Here are some of my attempts to have it working...\r\n\r\n- `ng serve --host '0.0.0.0' --deploy-url '/app' --base-href '/app' --serve-path '/app'`\r\n- `ng serve --host 0.0.0.0 --deploy-url /app --base-href /app --serve-path /app`\r\n- `ng serve --host 0.0.0.0 --deploy-url /app --base-href /app --public-host http://localhost:8888/app`\r\n- `ng serve --host 0.0.0.0 --deploy-url /app --base-href /app --public-host http://0.0.0.0:8888/app`\r\n- `ng serve --host 0.0.0.0 --deploy-url /app --base-href /app --live-reload-client http://localhost:8888/app`\r\n- `ng serve --deploy-url /app --base-href /app --live-reload-client http://localhost:8888`\r\n- `ng serve --host=0.0.0.0 --deploy-url=/app --base-href=/app --public-host=http://localhost:8888/app --disable-host-check --aot`\r\n\r\nI believe the issue to be related to cli 1.5, since it was working correctly just before upgrading.\r\n\r\n### The log given by the failure.\r\n<!-- Normally this include a stack trace and some more information. -->\r\n\r\nBrowser's (chrome, in this case) console shows the following:\r\n```\r\nhttp://localhost:8888/sockjs-node/info?t=1509897420616 404 (Not Found) (zone.js:2933)\r\n[WDS] Disconnected! (client:164)\r\n```\r\nChanging files no longer refreshes the browser\r\n\r\n### Desired functionality.\r\n<!--\r\nWhat would like to see implemented?\r\nWhat is the usecase?\r\n-->\r\nThe server and live reload to continue to work regardless of proxying or for the params to help configure the server to work through the proxy correctly.\r\n\r\n\r\n### Mention any other details that might be useful.\r\n<!-- Please include a link to the repo if this is related to an OSS project. -->\r\n\r\n- FYI. Mainly — but not exclusively — use this setup to avoid CORS issues and so that the app serving the API (running on 8080) writes the auth cookie and the angular app requests go through as authenticated.\r\n- This seems somehow related to #6440 but that one continues unsolved, the issue is not exactly the same and is on an older version of cli. I actually had the proxy working fine prior to upgrading to cli 1.5.0\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/342121095","html_url":"https://github.com/angular/angular-cli/issues/8360#issuecomment-342121095","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/8360","id":342121095,"user":{"login":"rart","id":3928341,"avatar_url":"https://avatars0.githubusercontent.com/u/3928341?v=4","gravatar_id":"","url":"https://api.github.com/users/rart","html_url":"https://github.com/rart","followers_url":"https://api.github.com/users/rart/followers","following_url":"https://api.github.com/users/rart/following{/other_user}","gists_url":"https://api.github.com/users/rart/gists{/gist_id}","starred_url":"https://api.github.com/users/rart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rart/subscriptions","organizations_url":"https://api.github.com/users/rart/orgs","repos_url":"https://api.github.com/users/rart/repos","events_url":"https://api.github.com/users/rart/events{/privacy}","received_events_url":"https://api.github.com/users/rart/received_events","type":"User","site_admin":false},"created_at":"2017-11-06T11:25:29Z","updated_at":"2017-11-06T11:25:29Z","author_association":"NONE","body":"I finally got it working using the command like \r\n```\r\nng serve --deploy-url /app/ --base-href /app --public-host http://localhost:4200/sockjs-node\r\n```\r\n\r\nAt this point, i'm not sure if this is a bug or not. What's curious is that prior to upgrading to 1.5.0 `ng serve --deploy-url=/app/ --base-href=/app` worked fine with my proxy setting. After the upgrade I need to specify the `public-host` (AKA `live-reload-client`) for the exact same env to work.\r\n\r\n*Observations*\r\n- Without the `/` at the end of the `deploy-url` some paths brake.\r\n- `ng serve --help` states that `--live-reload-client` is an alias for `public-host`. Based on how it works I'd argue that `public-host` as the name for that param doesn't make sense. `live-reload-client` makes more sense.\r\n- The explanation that @clydin provided here on `serve-path` it's clearer than what the `serve --help` explains. I think most of those on the `--help` could use better explanations."}}
{"actor":{"display_login":"rart"}}