wsmc

Enable Websocket support for Minecraft Java.
Back to Files

1.20.2-0.3-forge

File namewsmc-0.3-forge.jar
Uploader
rikka0w0rikka0w0
Uploaded
Oct 8, 2023
Downloads
35
Size
622.7 KB
Mod Loaders
Forge
File ID
4787979
Type
B
Beta
Supported game versions
  • 1.20.2

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:wsmc-920581:4787979")

Learn more about Curse Maven

What's new

On the server side, if a client joins via WebSocket, its handshake request can be accessed via the vanilla net.minecraft.network.Connection class. To obtain such information, cast a Connection instance into IConnectionEx, then calls IConnectionEx.getWsHandshakeRequest().

This is useful for obtaining information about the original request if the Minecraft server is behind a reverse proxy (e.g. a CDN). For example, header X-Forwarded-For and CF-IPCountry indicate the client IP address and the client country code, respectively.

This mod has no related projects