Skip to content

Vue UI - "open app" always opens on localhost #4032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aljaxus opened this issue May 20, 2019 · 2 comments
Closed

Vue UI - "open app" always opens on localhost #4032

aljaxus opened this issue May 20, 2019 · 2 comments

Comments

@aljaxus
Copy link

aljaxus commented May 20, 2019

Version

3.7.0

Environment info

  System:
    OS: Linux 3.10 CentOS Linux 7 (Core)
    CPU: (16) x64 Intel(R) Xeon(R) CPU           L5630  @ 2.13GHz
  Binaries:
    Node: 10.15.3 - /usr/bin/node
    Yarn: 1.16.0 - ~/.yarn/bin/yarn
    npm: 6.4.1 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Launch Vue UI on remote machine (vue ui --host 192.168.1.100), connect to UI, select a project and "serve" it. When compiled, the "open app" button will get enabled. Click on it and a new tab will open, but on localhost:8080 instead of 192.168.1.100:8080

What is expected?

I'd expect that the new tab would open on 192.168.1.100:8080 address

What is actually happening?

The new tab opens on localhost:8080 address


I understand that VueCLI is not made for remote work, but it would be very nice to have this issue sort of fixed. I am moving my whole "working" setup on one of my home servers and VueCLI is just too good to be left out.

@aljaxus
Copy link
Author

aljaxus commented May 20, 2019

Proposed fix is to use JS in browser to concatenate together the address string on client side.

const addr = `${window.location.protocol}//${window.location.hostname}:${port}`

So when someone would be at localhost:8000/tasks/leProject:serve the new tab would open at localhost:8080
And when someone would have the UI on a remote machine (ex. 192.168.1.100:8000/leProject:serve) the new tab would open on http://192.168.1.100:8080

@aljaxus
Copy link
Author

aljaxus commented Jun 11, 2019

Closing the issue - I found out that by setting the "host" parameter to the server address the "open app" button will open the app on correct address.

@aljaxus aljaxus closed this as completed Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants