Closed rysson closed 3 years ago
Maybe I can just use the same host and path, but just change the protocol to wss or ws depending on https or http?
Hopefully this should be fixed now. v1.0.3 . Make sure to clear browser cache, as frontend code is aggressively cached.
Thanks!
replace(/^http/,"ws")
– nice trick, I thought about it at night :-)
It resolves most cases, wws
is OK. Second part of my issue is base-url, I don't how to forward mount point from my proxy. I have external haproxy on gateway (it removes https and set X-Forwarded-Proto
), next nginx (on game machine, it rewrite /map
) and your map mod.
Then if you use absolute paths like /map
or /config
it doesn't work on proxy rewrite. Css, js and icons are pointed relative and work. I suggest remove /
from map and config.
I guess it will be works with 99% of cases. My 1% need to react on X-Forwarded-Proto
(if available) instead of location scheme too (proxy – mod uses http, but browser – proxy uses https).
Thanks for you work.
A create micro pull request #5.
My 1% need to react on
X-Forwarded-Proto
It seems that all work and do special code is needed for X-Forwarded-Proto
.
Thanks, I'll let you know when this gets released.
This should be released now (v1.1.0). Hopefully it's fixed for you.
It works like a charm, thanks a lot!
I have bug when I user a proxy, but this bug will be also occur on any https connection.
There is missing SSL (
wss
) forhttps
connections here https://github.com/kylepaulsen/ValheimWebMap/blob/eea559f341a263e2a0b20c499a4f3460ab1403d9/WebMap/web-src/websocket.js#L79Next issue is about URL, because I use rewrite on my server, than map is available in
/map/
preffix.Is it possible add config option with websocket URL (to set schema and path)? And/or use
X-Forwarded-Proto
header (to forcewss
ifhttps
)?