mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-10-25 08:44:28 +00:00
Add a new HttpHandler interface, which handles checkUrl, request and websocket calls for a computer. The default implementation is provided by a NettyHttp class, which also stores any related HTTP config and state. This is a little over-engineered, but has two advantages: - Our Javascript/TeaVM implementation can now just implement this interface, rather than patching/overwriting classes. - This removes the final (large) bits of global state/config from CC:T's core. Our tests no longer need to temporarily override global address rules, and the traffic shaping handler no longer requires resetting. It might be a bit nicer to move all the netty-specific code into a dan200.computercraft.apis.http.netty package, so there's some cleaner separation from the common code, but I'm trying to avoid moving code about any more than I have to.