PackHttpServer
Minimal HTTP server that serves:
- The pack zip itself on
<pathPrefix>, with the headers Geyser needs (Content-Type: application/zip + accurate Content-Length). If the pack file is absent, this route 404s — relevant when self-hosting hasn't produced a pack yet on a fresh backend. - Additional file-serving routes registered via registerFileRoute after start — used by the backend to expose its Bedrock-conversion outputs (
/bedrock.zip,/mappings.json) for the proxy to pull. These routes read the file fresh on every request, supportIf-Modified-Sinceso unchanged files return 304, and 404 cleanly when the file is absent.
Properties
Functions
Link copied to clipboard
Register an additional route that serves a single file from disk.
public void registerFileRoute(String path, Supplier<PackHttpServer.FileRouteDescriptor> descriptorSupplier, String contentType)
Register a dynamic route whose publisher can provide its existing SHA-1.
Link copied to clipboard
public void registerProtectedExecutableRoute(String path, Supplier<File> fileSupplier, Supplier<String> networkKeySupplier)
Registers a dynamically resolved executable JAR route protected by a capability-specific bearer token derived from the RSPM network key.
Link copied to clipboard
Compatibility overload for callers that publish one fixed file.
Bind and start.
Link copied to clipboard
public static PackHttpServer startWithDescriptor(Supplier<PackHttpServer.FileRouteDescriptor> packDescriptorSupplier, int port, String pathPrefix)
Starts the primary pack route with a producer-owned digest descriptor.