Host flag not working with serve
See original GitHub issueDescription:
I would like to test my app in the browser in a different domain other than localhost. The documentation says I can use the --host='domain.lcl'
flag but that does not work. It seems like Ionic is not passing the host to Angular CLI.
Steps to Reproduce:
New app and run ionic serve --source-map --ssl --consolelogs --devapp --host='domain.lcl'
Same problem without all flags except host
Output:
❯ npm start
> project@ start /Users/marvinheilemann/Documents/Project_name
> npm run dev
> project@ dev /Users/marvinheilemann/Documents/Project_name
> ionic serve --source-map --ssl --consolelogs --devapp --host='domain.lcl'
> ng run app:ionic-cordova-serve --host=0.0.0.0 --port=8100 --source-map --ssl --cordova-mock --consolelogs --consolelogs-port=53703
[ng] WARNING: This is a simple server for use in testing or debugging Angular applications
[ng] locally. It hasn't been reviewed for security issues.
[ng] Binding this server to an open connection can result in compromising your application
My ionic info
:
Ionic:
Ionic CLI : 5.2.5 (/Users/marvinheilemann/.nvm/versions/node/v10.16.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.7.4
@angular-devkit/build-angular : 0.802.2
@angular-devkit/schematics : 8.2.2
@angular/cli : 8.2.2
@ionic/angular-toolkit : 2.0.0
Capacitor:
Capacitor CLI : 1.1.1
@capacitor/core : 1.1.1
Cordova:
Cordova CLI : 8.1.1 (cordova-lib@8.1.0)
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v10.16.0 (/Users/marvinheilemann/.nvm/versions/node/v10.16.0/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.3 Build version 10G8
Other Information:
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
"Invalid Host header" when running Angular/cli development ...
The --disable-host-check flag works fine if you need to run from Cloud9. I use the following command: ng serve --open --host $IP --port...
Read more >ng serve - Angular
Option Description Value Type Default Value
‑‑hmr Enable hot module replacement. boolean false
‑‑host Host to listen on. string localhost
‑‑open Opens the url in default...
Read more >CLI - Parcel
The parcel CLI is the most common way to use Parcel. It supports three different commands: serve, watch, and build.
Read more >How do I Configure Flask Dev Server to be Visible Across the ...
The Problem Flask ships with a development server, ... server using the flask executable, you can use the host flag and pass the...
Read more >API - esbuild
If you still run into cross-platform quote escaping issues with different ... You can set the host on the command line by using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Open a new issue. Just a warning, it’s something we probably won’t be able to fix for a while.
I’m getting an error now about web socket mixed content, do you know how to solve this or should I open a new issue for that? It seems like with a custom domain the
--consolelog
flag does not work properly. And it does not open the browser with the give--address
.Mixed Content: The page at ‘https://domain.lcl:8100/auth/login’ was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint ‘ws://domain.lcl:53703/’. This request has been blocked; this endpoint must be available over WSS.