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

Determine urls using window.location #112

Open
indykoning opened this issue May 20, 2023 · 1 comment
Open

Determine urls using window.location #112

indykoning opened this issue May 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@indykoning
Copy link

Clear and concise description of the problem

When proxying the unlighthouse frontend it will try to access the API and websocket routes using the localhost:port url still as this is still the url it is originally hosted on, causing issues as described in: indykoning/unlighthouse-docker#1

Suggested solution

I think the best solution would be to use placeholders for the url in the payload.js and replace these with the window.location.origin so it will use the url you accessed the frontend with.

Alternative

An alternative is given in the respective issue by overwriting all the urls with that of the url you want

  serverUrl: "http:/<site>/",
  clientUrl: "http://<site>/",
  apiUrl: "http://<site>/api",
  websocketUrl: "ws:///<site>/api/ws",

however this does not work if you can access the same unlighthouse instance from different urls

Additional context

No response

@indykoning indykoning added the enhancement New feature or request label May 20, 2023
@harlan-zw
Copy link
Owner

Agreed! It shouldn't rely on hardcoded paths

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

No branches or pull requests

2 participants