@Mod(HifiMC.MOD_ID) public class HifiMC { // ... // Convenience method to create and configure a ContextHandler. private static ContextHandler createContextHandler(String contextPath, Handler wrappedHandler) { ContextHandler ch = new ContextHandler (contextPath); ch.setHandler(wrappedHandler); ch.clearAliasChecks(); ch.setAllowNullPathInfo(true); return ch; } // ... private void doClientStuff(final FMLClientSetupEvent event) { // Server webServer = ... ContextHandlerCollection handlers = new ContextHandlerCollection(); WebSocketHandler wsh = new WebSocketHandler.Simple (LocationDataWebSocket.class); handlers.addHandler(createContextHandler("/locdata", wsh)); // TODO: Add a handler for a static webpage webServer.setHandler(handlers); // webServer.start() ... } // ... }