CraftProxy - Reduce bandwidth use by caching chunk data Version: 156 Description This plugin allows chunk data to be cached locally by players. This reduces the bandwidth required for hosting the server. The .jar file is both the plugin .jar file and an executable .jar file. It is run as a plugin for the server and a stand alone Java executable by players. For ease of use the local version has a GUI. Players just need to double click the file and press start to start the GUI. The player then connects to the server via the local proxy. When downloading cached chunks, the bandwidth is reduced by a factor of around 4-5. Features: GUI means easy to use for players Caching of chunk data locally Automatic reconnect for inter-server teleporting Can bind to a specific local IP address Can connect to servers based on the hostname provided by the client (NEW) How it works Thanks to @Kimundi for the diagram The CraftProxyLite.jar file is a proxy server and it can be run in a few different modes. It listens on 1 port on the local computer and connects to another server somewhere else. If you double click on the .jar file, it starts the proxy in local-cache mode. If you start it as a plugin, it starts in remote proxy mode. The local cache mode has 2 ports Listen on: localhost:25565 Connect to: <remote hostname that you type in>:20000 The remote proxy mode has 2 ports Listen on: 20000 Connect to: localhost 25565 The Bukkit server has 1 port Listen on: 25565 Note: If you run everything on 1 server then the port 25565 is used twice, so will cause a collision. That is why when testing it out on 1 computer, you should change the local cache listen on to localhost:25564 Ok, so the process is that you connect to the local proxy with your minecraft client. 1) You connect the minecraft client to localhost (or localhost:25564 if all on 1 computer) 2) The local proxy accepts your connection 3) The local proxy connects to <remote hostname that you type in>:2000 4) The remote proxy accepts this connection (It was listening on 20000) 5) The remote proxy connects to the Bukkit server on port 20000 So you end up with <minecraft client> connects to <local-cache proxy> connects to <remote/plugin proxy> connects to <minecraft server> The local-cache to plugin proxy connection is over the internet and has reduced bandwidth. Download Download Download 1.0.1 version Older versions Source Code FAQ Faq Parameters You can see a full list of parameters by typing Code: java -jar CraftProxyLiter.jar help Note: auth_off only controls if the proxy does checking, it has no effect on the server For authentication, you should either have the proxy or the server handle authentication. Parameters Setup Server Basic Download .jar file and place it in the plugins directory Forward external port 20000 to port 20000 on your server Sometimes Required start server stop server open /plugins/Craft Proxy Lite/proxylite.txt find default_server=25565 replace with <local-ip of server>:25565 (see Faq for more info) start server again Players Not on the same computer as the server Download .jar file and double-click Enter your server's details into the GUI (mostly Remote Server -> Name) Press start Connect to localhost with their client On the same computer as the server Download .jar file and double-click Change the listen port for the local server Instead of 25565, use 25564 Press start Connect to localhost:25564 with their client Advanced Note: You should only have authentication on for either the proxy OR the server. If you switch on authentication for both, then players won't be able to login. running the proxy stand alone Client Mode (no GUI) Code: java -jar CraftProxyLiter.jar 25565 <target-server-hostname>:20000 local_cache auth_off Server Mode (not as a plugin) Code: java -jar CraftProxyLiter.jar 20000 25565 auth_off Changelog: Version 36 Released as plugin and with client GUI Version 40 Bukkit server now handles authentication (bug fix) Removed the need for the server to use any disk space Only sends nearby hashes when a cache hit is detected (rather than sending all hashes in cache) Version 41 Saves GUI settings to file Version 43 Fixed bug where server didn't shut down when the plugin was reloaded Added big warning when plugin can't bind to port Reset default connect port back to 20000 (accidentally had set it to 25565) Version 44 Actually, fixed the server shut-down bug Version 45 Fixed a bug where player had to restart GUI to get the benefits of caching Version 46 Proxy will retry all local IP addresses if "localhost" fails Version 47 Fixed a bug where players were kicked with a negative array length exception Version 48 Fixed a bug where a thread wasn't closing properly Added support for variable cache disk sized to the GUI Version 49-52 Null pointer exception fixes Version 54 Flushes the output streams after each packet (latency improvement) Version 55 Increases connection timeout delays to 45 seconds (up from 20 seconds and in a few cases 4 seconds) Version 65 Re-write Adds a fairness manager to prioritize packets Adds a buffers so packets are grouped into larger packets Note: The new command line requires the auth_off Version 67 Fixed a bug that was causing hashes not to be transferred, when a player reconnected Removed "lock" spam Version 71 Reduced max latency for buffering from 100ms to 10ms Version 72 Added bufferlatency command line option "bufferlatency 0" would disable buffering. Fixed bug where actual latency was higher than max setting Version 73 Added compression_level switch for the command line 1 = fastest compression 9 = best compression Version 75 Added version number to GUI Version 76 Added latency field to the GUI Version 77 Removed delay through fairness manager spam Version 78 Changes to the fairness manager Version 79 Output buffering disabled Version 80 Fairness manager will only send low priority packets if there are no high priority available Version 81 Bypass fairness manager Version 82 Made the previous change thread safe. Version 83 Cache disk size fix for GUI Changed window GUI title Output buffer re-enabled (set to 0 by default) Version 84 Added reconnect functionality for Server Port Version 85 Added support for starting as a plugin Version 86 Fixed player entity id mapping error (prevented damage sounds/lava fire) Removed most of the remaining code for the fairness manager Changed the order in which sockets are closed Version 87 Fixed authentication for multiple servers Fixed rain packet, when teleporting between servers Version 88 Removed time when logging in plugin mode Version 89 Terminates all streams with a kick packet. This should reduce client crashes. Version 90 Added password support (for proxy to proxy connections) Version 91 Improved handling of IO exceptions Version 92 Updated some of the comments for parameters Version 93 Removes players from reconnect cache if login fails (previously it was only if the socket couldn't be established) Version 94 Fixed a chunk load/unload tracking issue that was causing spam (and probably unnecessary packets to be sent) Version 95 Added ban and white list functionality (data is refreshed from the file every 30 seconds) Version 96 More info about connection type Version 97 Version 1.6 protocol support Version 98 Fixed bug with optional fields in 0x17 packet (caused packet parsing error for falling sand) Version 99 Fixed a bug with the map update packet and also kick messages must now start with [Serverport] to be considered reconnect requests Version 100 Redirects (global_hostnames) will default to port 25565 if none if given Version 101 IPs are also checked against the banned file list Version 102 Better error messages if buffer mis-sizing occurs Version 103 Fixed Reconnect file support (actually stores data now) Added reload and save support for reconnect file Added Bukkit Contrib support (still doesn't exactly match Afforess' code) The kick message can start with [Redirect] instead of [Serverport] (aesthetic change) Version 104 Fixed broken download link Version 105 Teleporting from the nether on one server to a normal world on another server will now update sky colour. World seed still can't be updated . Version 106 Exception handling Version 107 The IP address of the listenTo parameter can now be used to set which local IP the server is bound to. Version 108 Added a bandwith_limit option in kbps. This sets the max speed of transmission to clients (client download speed). Version 109/110 Added white list support to plugin mode Version 111-112 Compile readme, no functional changes Version 113 Added timer to save the reconnect file every 10 seconds Version 114 Added a /memdump command which dumps the proxy memory to a file Version 115 Removed bandwidth limiter. This should fix disconnects for versions 108 - 114 Version 116 Client switches to terrain loading screen when switching servers Version 117 Re-tries authentication if the server times out Version 118 Adds attempt 1 of Mod Loader MP support Version 119 Packet support for 1.8 Version 120/1 Fixes due to changes to the way the respawn packet works Version 122 Separated flood protection for ping connections Version 123 Added command line parameter for controlling the timeout Version 124 Attempt 2 to fix flood protection with ping connections Version 125 Initial attempt at support for 1.0.0 protocol Version 126 Added back in the rotate IP address functionality (and set it to ON by default). This means that the proxy connects from various 127.0.x.y addresses. This fools the server into thinking the proxy is connecting from a different location for each player. This is required to bypass the server's flood protection system (where a script is used to connect over and over to the server and crash it). Notch had changed his code so that localhost connections were exempt, but he has added it back in again for some reason. Version 127 Changed it so that the challenge code sent by the proxy is a positive long. Previously any long would work. Version 128 Bug fix for enchanted items courtesy of Dafluf Version 129 1.1 compatibility Version 130 Fixed a bug when clients reconnect Version 131 Fixed another reconnect bug Version 132 Changed error message due to mismatched version numbers Connection will timeout if the a correctly formatted login packet isn't sent within 1 second Version 133 Increased timeout when logging in to 10 seconds before it assumes a version mis-match Version 136 Added better error reporting when the buffer overflows Version 138 Fixed a bug with version 136 and another with 137 Version 139/140 2 Null pointer fixes Version 141 More debug info when buffer overflow occurs Version 142 Possible fix for buffer overflow error Version 144 Updated the protocol to 1.2.3. I still need to check if compression still works. Version 146 Fixed bug with packet 51 - caching is still not operational Version 147 The updated protocol means that full chunk update packets aren't always 81920 bytes Caching now actives on all packets > 16384 instead of only for 81920 byte packets This supports cubic chunks (and the new "expanded" packets) Version 148 Fixed a bug with the password based LAN to LAN connection system Version 149 Increased circular buffer sizes due to new protocol Version 150 Correctly copied "dummy" integer for chunk packet Slightly improved error checking when compressing/decompressing Version 151 Reduces chunk not initialized spam Version 152 Fixed misrepresentation of the updated packet 52 in the code Version 153 Made warning for unallocated chunks optional (defaults off) This is not a protocol error with the new protocol Version 154 Added hostname support, the parameter and others are described here Version 155 Added packet for 1.2.4 compatibility (should still be compatible with 1.2.3) Version 156 Fixed bug with respawn packet, proxy should now properly reconnect between servers Version 161 Spoutcraft compatibility Slight change to rotate localhost system This is probably fixed, so no big deal. Memory Issue - Memory Dumps needed (Help needed) There is a memory leak of some kind that is caused by an interaction between the latest CB recommended build and Craft Proxy. I need a memory dump of the proxy when the problem occurs. Code: java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port="9004" -Dcom.sun.management.jmxremote.authenticate="false" -Dcom.sun.management.jmxremote.ssl="false" -jar CraftProxyLiter.jar 20000 25565 adminname raphfrk <listen port> <default hostname> adminname <your username> <add the rest of your parameters> You can then perform a memory dump by connecting to the proxy and entering the /memdump command. You must connect using the username you provide in the command line for adminname. Until I fix this craft proxy will have lots of latency.