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

Websocket URL wrongly defaults to localhost #12

Closed
nono-gdv opened this issue Oct 13, 2022 · 2 comments
Closed

Websocket URL wrongly defaults to localhost #12

nono-gdv opened this issue Oct 13, 2022 · 2 comments

Comments

@nono-gdv
Copy link

Hello,

I am trying to run pyvtt with its default configuration in a throwaway, private LXC guest (so no name, no DNS configuration whatsoever, just a local IP address). From inside the LXC:

root@bullseye-bl35UhyVrM:~# ip -br a sh dev eth0
eth0@if8         UP             192.168.155.120/24 fe80::7c91:7fff:fea4:201b/64 
root@bullseye-bl35UhyVrM:~# getent hosts 192.168.155.120
root@bullseye-bl35UhyVrM:~#

I access the app as http://192.168.155.120:8080 from my local browser. However, when trying to log in, the app gives me ws://localhost:8080 as a websocket URL, which the browser can't connect to.

From my understanding of the code, the URL is generated as something like "localhost by default, unless I can find a better value"; this corner case does not seem to be covered.

@cgloeckner
Copy link
Owner

cgloeckner commented Oct 13, 2022

Hey,

if you're running the VTT in your LAN, you need to tell the VTT which IP to use to generate such URLs (because it cannot tell whether you're going public on the internet, private on your LAN or super-private for localhost-testing).

Check your settings.json (defaults at ~/.local/share/pyvtt/) and use your LAN-IP as domain inside the hosting-sections.

"hosting": {
    "domain": "192.168.155.120"
}

Hope that helps :-)

@nono-gdv
Copy link
Author

Yes, thanks! I was hoping to get something a bit more automagic, maybe generated from the initial HTTP request, but I understood after posting that the websocket URL is global and not per-request.

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