[MISC] CraftProxy 0.2.0 - Reduce bandwidth use by caching chunk data [1.6]

Discussion in 'Archived: Plugin Releases' started by Raphfrk, May 1, 2011.

  1. Offline


    CraftProxy - Reduce bandwidth use by caching chunk data
    Version: 0.2.0


    This plugin and local client allows chunk data to be cached locally by players. This reduces the bandwidth required for hosting the server. It also helps users who are on slower connections.

    I am not sure what the status of this system is. It doesn't count as a plugin, since it has 2 parts.

    Even when running the plugin, players who don't use the client proxy can still connect. However, they will use the full bandwidth.

    The system can reduce bandwidth by 70-90% (after the 2nd login).



    Add the plugin file to the plugins folder


    Start minecraft client and login
    Double click on the client jar file
    Enter login details
    Enter the server location/port in the GUI
    Press start on the GUI
    Connect to localhost on the minecraft client

    Stable Builds

    None yet

    Dev Builds

    Warning: These may not be stable


    Had it get the compress/decompression gain backwards.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 14, 2016
    Jushy, Martin1704, Nathan C and 24 others like this.
  2. Offline


    Wait, I wont need a client mod for this?
  3. Offline


    The download link isnt working for me, cant connect to the server.
  4. Offline


    Will this support/runs fine with 300+ players ?
  5. Offline


    Forgot to set the thread to watch. Was wondering why nobody responded, I thought it was at least worth responding to.

    No, the players run the proxy locally. They connect to the proxy and it connects to the actual server.


    [[ MC Server <-> server-proxy-plugin ]] <-reduced bandwith-> [[ local proxy <-> Player's client ]]

    The local proxy caches the info, so the server plugin/proxy doesn't have to send as much data over the internet.

    I have tried to make it as easy as possible.

    The player just needs to double click on the .jar file, type in your server's address and press start.

    It is working now. I might have been uploading at the time or the site may have been having difficulties.

    Dunno, but didn't think there was any 300+ servers (around 100 was the limit).

    It improves bandwidth usage, but running the proxy uses CPU.

    I have to decompress the chunk data, scan it for cached matches and then re-compress it.

    It is threaded, so it should take advantage of a multi-core CPU.


    Anyway, I have updated. It now saves the cache to disk.

    Logging on uses around 80% less bandwidth than normal the second and later logins (and slight more for the first login).
  6. Offline


    So players use a local cache instead of downloading chunks from the server.
    - Does the server tell the proxy which chunks are "dirty" or will the proxy show unupdated chunks?
    - How many chunks are saved to the client? Does it keep ALL of them until minecraft is closed?
    - Can players without the .jar connect normaly to the server?
    - If I run both server and client on the same computer, does this improve something? (I wouldn't think so but it doesn't hurt to ask)
    MCbyWay likes this.
  7. Offline


    Looks like my ISP is blocking it or something cause i could download it using a proxy.
  8. Offline


    Each chunk is sliced horizontally into 16 pieces. A hash is generated for each piece.

    The server just needs to remember these hashes. If it hits a hash that it knows the client has a block for, it just sends the hash.

    There is a (tiny) chance that two chunks sections would give the same hash by accident.

    So, the memory use is

    - server stores hashes for all active connections
    - client stores hashes + the actual block data for just its own connection

    The hash is 8 bytes and the chunk section is 16x16x8 = 2048 bytes, so the hashes are much smaller than the actual chunk section data.

    When the client connects the next time, it sends the server a list of hashes that it has.

    It saves them as "soft" references. This tells the garbage collector that they can be removed, but only if necessary.

    They are also backed up to disk, so the next time the player needs them they can be loaded.

    Also, both client and server can be set to limit the size of the cache. It defaults to 10MB, though I think it should be higher for the client.

    Yes, in fact, you could have 2 different ports if you want. The is no point in having the proxy handle players who aren't using the cache.

    No. In fact, it would make it worse. You would be compressing and decompressing the data for no reason.

  9. Offline


    post header is missing description, title is missing version

    I did that for you but did you read my entire post?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 14, 2016
  10. Offline


    I thought you meant to add more info to the start? Was it just having a "description" heading?

    Also thanks for moving :).
  11. Wait , I don't really understand how this works ( I'm french and my english isnt perfect ^-^ ) So I have to ''install'' this on my server and Portforward to 20000 ( TCP or BOTH ? ) my friends won't have to install this or to portforward ?
  12. Offline


    I would say you just need TCP forwarded. Also, the fowarding is only needed for the server, not for players.

    The defaults should work.

    Download the .jar and place it in your /plugins directory

    * Download the .jar
    * Place it in some directory
    * double click on it

    (you need Java installed)

    This will open a GUI. Enter the name of your server and press start.

    Run the minecraft client and connect to localhost:20001

    This will connect your client to the local proxy and onward to your server:20000

    I would love to know if people have tried this :).
  13. Thanks for the Fast reply , On http://canihostaminecraftserver.com/ it told me that I could only host 2 players and me with my connection , Will ur plugin improve my server connection ? ( I will try it , I portforwarded and installed it but my friends will have to connect to localhost:20001 too ?. Last Question ^^ Do I still have tu run my bukkit on my old IP ( ex: my friends were loggin on minecraftxxxx.no-ip.org ? Thanks for that awesome pluggin and keep it up ! Ohhh We need to be premium ! :O is there a way to Put '' online-mod '' to offline ?
  14. Offline


    It depends on why you can run 2.

    One option would be to double your upload and download speeds from what you typed in originally and see if that helps.

    If that helps, then the cache should help.

    No, they need to download the .jar file and run the proxy on their computer.

    Yes, your friends type in that address into the gui to connect.
  15. Thanks I got it ! And for the premium account . Is there a way to turn the online mod off ? Just to play in LAN or things like that
  16. Offline


    I got an error "Failed to verify name" this was however fixed by putting the server in offline mode, the server is on my local network so that might be the reason. I haven't tested it further, seeing as I'm on my way to bed.. Otherwise I've noticed a tad lower bandwidth usage..
    MCbyWay likes this.
  17. Offline


    If you are playing on a LAN, then you probably don't need caching?
  18. So that means my friends have to buy the Game .
  19. Offline


    So do the players need ot download anything?
  20. Offline


    hey i was just wondering what does Backend server mean? probably a stupid question
  21. Offline


    i like it
    but no offline mode
    so i can't use it:p
  22. Offline


    This. looks. EPIC 0.0

    Will try on my server today and report results 8D

    Got a quick question, mind you I'm no Java programmer or anything XP

    But if these chunks are cached, does this mean that the chunks are saved locally?

    So if I were to say - Stand on one chunk and warp back to it later the load up of the 1st chunk would load up faster?

    Just wondering if this speeds up warps or basically areas in game that the player has already been to =o

    Then that gives a use to use this on lan?

    On another note I am attempting to test this locally and I keep getting the same error above even on offline mode and authentication disabled in the plugin xD

    I'll eep trying and report back tonight =D


    They need to use the jar above to connect with caching otherwise they're just connecting normally, instructions are in the original post ^^

    I'm trying to get this to work online but I noticed in the plugin settings file there is a auth section. switch it to false and see if that works.

    This is odd... I have a player willing to help me beta test outside lan later in the day, but i tried running on the same machine just as a simple test and this was the result I got:

    I replace my username and things here with censored for security purposes however it's rather confusing, from what I see my account has been authenticated at minecraft.net successfully so why am I still unable to connect at the "backend" server?

    Tried with build 36 and 37 of your plugin.

    Bukkit 740 installed with a plugin list if you need it.


    2nd attempt: The 1st time I ran the plugin client I set it to localhost at ip 20000. this time I tried 25565 and I get a weird Outdated server error 0.0

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 14, 2016
  23. Offline


    I almost forgot, I'm using this string to start minecraft so I don't crash (it's a problem with nvidia cards it appears. Theres a whole thread about it on the minecraft support forums http://getsatisfaction.com/mojang/topics/bwod_black_window_of_death).

    How do I combine this with your jar?

    "C:\Program Files\Java\jre6\bin\java.exe" -Xmx512M -Xms512M -cp "D:\Minecraft\minecraft2.jar" net.minecraft.LauncherFrame
  24. Offline


    @MCbyWay: See that shiny edit button below your posts?

    That's what we click on to avoid 5 back to back posts from 1 person. :p

    This plugin's a great idea, thanks Raph!

    Sadly I'm a LAN host, so no test info from me :)
  25. Offline


    Unable to open socket to localhost:25565, it is what my server is running on :p
  26. Another epic looking plugin Raph.

    Tested this, I am getting the same issue as an earlier poster. "Outdated server" error.

    Pretty sure I set it up correctly. but perhaps something special is required in the config?

    I have default:

  27. Offline


    You might need to set the "Client Version"
  28. Offline


    Ok I think I need to have the server version connect to not localhost, as my server has multiple IP's and localhost is different then the IP my serv is bound to.
  29. Offline


    Well, they should :).

    I could change it so that is has offline mode. Putting in online mode was actually harder than skipping auth :).

    Are you using a vitual LAN then?

    That is the actual CraftBukkit server. It is saying that it can't connect to it for some reason.

    It should be the same start-up. It isn't a server mod, just a plugin.

    The client connects to the local proxy.

    I will look into it.

    Actually, it might already work. Can you try editing the config file in

    /plugins/Craft Proxy Lite

    There is a parameter called auth_off, you could try setting it to true.

    Obviously, this has the same security issues as online-mode = false.

    This is in the server logs?

    Can you open the config file and set

    default_server to
  30. Tried that, leads to:

    11:21:46 [INFO] Unable to parse numbers
    11:21:46 [INFO] Usage: craftproxy <listen hostname>:<listen port> <default hostname>:<default-port> .... parameters
    11:21:46 [INFO] Stopping server

Share This Page