BlueMap-Minecraft / BlueMap

A Minecraft mapping tool that creates 3D models of your Minecraft worlds and displays them in a web viewer.
https://bluecolo.red/bluemap
MIT License
1.9k stars 130 forks source link

[FEATURE]Use WebSocket #244

Open zyxgad opened 3 years ago

zyxgad commented 3 years ago

I suggest bluemap use WebSocket to get data, that will reduce many unnecessary web request. Of course, bluemap need keep http API to compatible with the old client

roobscoob commented 3 years ago

If this is to be implemented, please keep the HTTP fetch option as a persistent choice. (i.e. don't deprecate/remove it). When deploying BlueMap at scale (for example, as an interactive component displaying a static world on a website) HTTP fetches are much better, as tools exist to optimize the delivery of static content over HTTP. These same tools do not exist for WebSockets

FinlayDaG33k commented 2 years ago

Do note that if websockets are going to be used, we'd also need to implement RFC 7692 in order to use some compression.

TBlueF commented 2 years ago

There is currently no intend to use web-sockets for the map-tiles .. in my opinion, http-requests are perfectly fine for that :) The web-sockets would be for live-updates like player-markers

mrsolarius commented 4 months ago

Maybe instead of web socket, just use server side event ?

TBlueF commented 4 months ago

I will consider it, yes :)

FinlayDaG33k commented 4 months ago

With HTTP/3 becoming more common by the day, I'd say websockets wouldn't add much anymore.
The only thing I'd see websockets being useful for, is making things like player-locations be available in a more real-time fashion as mentioned in https://github.com/BlueMap-Minecraft/BlueMap/issues/244#issuecomment-968326350.

Pros

Cons

I do not know how the internal webserver works from a code-perspective but I think the changes should be relatively minimal while still having a bigger impact than using websockets would have.

Chicken commented 4 months ago

HTTP/3 is unlikely to be ever supported by BlueMap as it has been previously established that BlueMap won't support TLS by itself. To use HTTP/3 one should host the website with an external webserver such as nginx.

brianclogan commented 3 months ago

I would say using websockets for external live updates would be amazing. Maybe if hosted by the server it still does HTTP requests, but if you move external you have the option of using websockets instead of ajax requests for player positions.