Dantevg/WebStats

index.html from internal web server only works on localhost

LcorpOfficial opened this issue ยท 9 comments

URL: http://lcorpnet.ddns.net:8094/

Keeping this up so it can be checked to see the result

Config: https://pastebin.com/ckET1DVj

Mostly just added a bunch of placeholders for testing

Doesn't seem to initialize the table. works on a localhost test server fine. when running from a hosted server (Pebblehost) I get a similar result to this but no error in console? Stats.json IS propagated from checking.
#16

Paper: 1.18.2

I'd be happy to offer other info if needed

noticed an interesting bit in the console on chrome:
image

note: it does work on a self hosted page accessing the server remotely. just the internal webserver breaks.

Hi! Thanks for the nice bug report!

Maybe I'm not awake enough for this yet, but I'm a bit confused about the local/hosted Minecraft server and internal/self-hosted web server ๐Ÿ˜„. I listed the possible combinations here:

  1. Minecraft server: localhost, web server: internal
  2. Minecraft server: hosted, web server: internal
  3. Minecraft server: localhost, web server: localhost
  4. Minecraft server: hosted, web server: localhost or other host

If I read correctly, the combination (2) of hosted Minecraft server and internal web server breaks, correct?

From what combination is the browser console screenshot you posted? Since it breaks and it mentions localhost I assume it is combination 1, correct?

I think I found the issue. The index.html gets the correct port to use from a cookie set by the web server, but it always uses localhost as address. This worked fine during testing because I only checked on my own machine ๐Ÿ’€.

The fix is to also get the IP address from a cookie, just like the port. Fix coming soon!

Closed in 9d4e6a6. Version 1.7.1 coming!

Should be fixed in 1.7.1 which is now downloadable from both the Spigot page and the Github releases ๐Ÿ˜„

Nice! that was right on the money! I still plan on self hosting since I have other plans for what to do with the data (player profiles that can be opened by searching names) but having this work is good for others! I have so much data that the builtin table gets Looooooooong.

I'll likely use SQL and make my own js applet for parsing it and forwarding to a formatted page, but thanks for the cool plugin!

Haha nice! Will it be public / can I see it when it's done? I'm interested to see what you make! ๐Ÿ‘€

absolutely, it'll take some time with other projects but once it's done I'll def drop links