Skip to content
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

linux binary on a staging server still pings localhost for watch-editing #815

Open
hyphae-lab opened this issue Aug 25, 2023 · 1 comment

Comments

@hyphae-lab
Copy link

hyphae-lab commented Aug 25, 2023

Maputnik version: linux binary: maputnik version Editor: 1.7.0; Desktop: 1.0.7
Browser: Chrome
OS: macOS

Description of the bug:
The linux binary won't watch/edit style even if all permission groups are allowed to write on AWS Ubuntu
An error that says "GET http://localhost:8001/styles net::ERR_CONNECTION_REFUSED"
It seems like the Javascript embedded hostname is localhost and it is not able to ping back the server from the browser.
Also, it works just fine on my local machine where the host IS localhost.

Steps to reproduce the behavior:

  1. Download latest linux binary from github page
  2. Unpack zip
  3. Run ./maputnik --port 8001 --file ./style.json --watch
  4. Load editor in browser
  5. Change map
  6. check if style.json has changed

Style file or style URL:
(http://ec2-54-188-62-113.us-west-2.compute.amazonaws.com:8001/#0.55/0/0)

Screenshots:
n/a

@kevinschaul
Copy link
Collaborator

Hi @hyphae-lab I did some digging around the code, and it appears you can add two URL parameters to resolve that: localhost and localport. Here is the relevant code.

Are you able to test this? http://ec2-54-188-62-113.us-west-2.compute.amazonaws.com:8001/?localhost=ec2-54-188-62-113.us-west-2.compute.amazonaws.com&localport=8001#0.55/0/0

I'm not sure why the code does not default to whatever host it is on. It does seem to do that for port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants