Description:
I run ionic lab on a dev server on my local network. When upgrading to latest ionic-cli version it's no longer possible to connect from ionic-lab to the angular dev server since it always tries to connect to localhost instead of the address of the server. The problem is that localhost is hard coded in
|
const url = `${serveDetails.protocol}://localhost:${serveDetails.port}`; |
It should probably look at the address of the command which ionic serve is started with, and if there is something else than 0.0.0.0 (which is also default), this address should be used when starting ionic-lab.
Steps to Reproduce:
- Get two computers
- Get the ip of the first machine, for example 192.168.1.1
- Run ionic serve --address 192.168.1.1 --lab --lab-host 0.0.0.0 -- --disableHostCheck
- From your other computer, try to access 192.168.1.1:8200 (ionic lab) -> Does not work, because it tries to connect to localhost:8100 instead of 192.168.1.1:8100
My ionic info:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.2.0
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.4.1
Cordova:
cordova (Cordova CLI) : not installed
Cordova Platforms : not available
Cordova Plugins : not available
System:
NodeJS : v10.15.3 (/usr/bin/node)
npm : 6.4.1
OS : Linux 3.10
Other Information:
Should be easy to just use the correct variable from the ionic serve command on this row (
|
const url = `${serveDetails.protocol}://localhost:${serveDetails.port}`; |
) instead of hardcoded localhost-string. The ionic-lab bin already supports this, I have tested to do the change locally.
Description:
I run ionic lab on a dev server on my local network. When upgrading to latest ionic-cli version it's no longer possible to connect from ionic-lab to the angular dev server since it always tries to connect to localhost instead of the address of the server. The problem is that localhost is hard coded in
ionic-cli/packages/ionic/src/lib/serve.ts
Line 715 in 44b0918
It should probably look at the address of the command which ionic serve is started with, and if there is something else than 0.0.0.0 (which is also default), this address should be used when starting ionic-lab.
Steps to Reproduce:
My
ionic info:Other Information:
Should be easy to just use the correct variable from the ionic serve command on this row (
ionic-cli/packages/ionic/src/lib/serve.ts
Line 715 in 44b0918