pdinklag / MinecraftStats

A Minecraft player statistics browser for the web - supports 1.13 and later!
https://discord.gg/brH5PGG8By
Other
226 stars 53 forks source link

Integrated Webserver for the Plugin #236

Open pdinklag opened 7 months ago

pdinklag commented 7 months ago

MinecraftStats currently relies on the fact that users have a webserver, either one that they maintain manually, or one provided by supported plugins (currently dynmap and BlueMap).

As far as I know, there is no actively maintained plugin that does nothing but host a webserver. If anybody knows of one, I would very much appreciate if you let me know so I could add support for it.

Otherwise, MinecraftStats could provide a webserver of its own. That would have to be a very stable one and easy to integrate, preferably a Java library with a short list of dependencies. The goal is to make things easier, but without bloating up the project so half of the code is for running a webserver. I would appreciate suggestions and/or contributions.

Dad-Ju commented 6 months ago

One of the people at Bluemap found this, just to dump it here ;) https://docs.oracle.com/en/java/javase/18/docs/api/jdk.httpserver/com/sun/net/httpserver/SimpleFileServer.html

pdinklag commented 6 months ago

One of the people at Bluemap found this, just to dump it here ;) https://docs.oracle.com/en/java/javase/18/docs/api/jdk.httpserver/com/sun/net/httpserver/SimpleFileServer.html

Thanks! I was pretty sure this would be specific to Oracle Java due to the namespace, but OpenJDK seems to support it. This hit me:

intended for testing, development and debugging purposes only

There's no real elaboration, and the JEP 408 only states a few notes in the non-goals. It's likely not the most performant of web servers and not recommendable for a large server that expects many requests, but this could also be added as a side note. It also doesn't support HTTPS, which may be an issue seeing how browsers are developing.

Still, this should be a viable addition if Java 18 or later is detected!