[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

    Raphfrk

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

    Description

    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).

    Setup

    Server

    Add the plugin file to the plugins folder

    Client

    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

    Client
    Plugin

    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

    awesomebilly

    Hi, I'm bumping my head all day long at this :)
    I'm using transporter and this proxy.

    I have a few questions about craftproxy.

    1: If I run it as stand alone does it work to switch users between servers?
    2: Does it know this automatically? If not, how do I configure it
    3: If question 1 is wrong, do I need it in all my local machines plugin directory.


    The issue I'm facing is... Transporter works perfectly when using spoutcraft without craftproxy.

    When I try to use the normal minecraft (unmodded) + craftproxy + transporter I get a [Craftproxyliter] "Protocol time out" error. Is this because I've set up craftproxy wrong? or because it is not updated to 1.2.5?

    when I get this working I plan on donating to your awesome work sir.
     
  3. Offline

    Raphfrk

    I was thinking about this, and I don't think it will be possible to support caching anymore (at least in the short term).

    The process for caching is

    Client <-> local proxy <-internet-> server proxy <-> Server

    The way it works is that the local proxy just passes the connections both ways until login has completed. This means that the the client can login and authenticate with the server as normal. The proxy doesn't need the player's password.

    Once login is completed, it can modify the packets as required for caching.

    However, the new encryption system means that once login is completed, the connection is unreadable, so I can't detect the chunk update packets and even if I could, I can't change them.

    This is, in fact, the point of the encryption. It prevents a "man in the middle" attack. If you accidentally connected to a corrupt server, they could fake your login to some other server and then take control of the connection once you had logged in. It would appear to you like there was a login failure. Once again people abusing the system have made it harder for honest people :(.

    The only way around it would be either having the player typing their password into the local proxy, or creating a whole separate authentication system (with dedicated passwords).

    The reconnect functionality is not affected. The server proxy can handle login as currently, the effect would be

    Client <- encrypted internet -> Server Proxy <- LAN unencrypted -> Server

    So that is going to be my focus.
     
  4. Offline

    awesomebilly

    You sir are a genius :)
     
  5. Offline

    GlowDragon

    Nice plugin, but please use BukkitDev!
     
  6. Offline

    Autogire

    Hey it works perfectly. I'd like to prevent players from connect directly to the server instead of using craftproxy client.
    How can I do it please ?

    Client :
    mineattaque.myftp.org 20000
    localhost 25565

    Some players are lazy and direct connect to mineattaque.myftp.org 20000 with Minecraft. The server has a little bandwith and it laggs.
     
  7. Offline

    ewized

    I'm sorta confused and I cant figure out how to get: Can connect to servers based on the host name provided by the client, that working. Can you give an example or something.
     
  8. Offline

    Autogire

    3 ways to connect ( minecraft server listens port 25565, craft proxy server listens port 20000, craftproxy client listens port 25565 )

    1)Client doesn't use craftproxyliter client and connects to mineattaque.myftp.org:25565
    So client > mineattaque.myftp.org:25565 > lag

    2) Client doesn't use craftproxyliter client but enters mineattaque.myftp.org:20000
    So client > craftproxyliterserver:20000 > no caching mode > mineattaque.myftp.org:25565 > lag

    3) Client use craftproxyliter client and enters localhost
    So client > localhost:25565>craftproxyliterserver:20000>caching mode> mineattaque.myftp.org:25565 > no lag

    I want only 3) to be used for no lag

    Basicly, 1) is not possible because i closed port 25565 so ok
    But for 2) I didn't know how to refuse connections which don't use caching mode
    Indeed, if I closed port 2000 then 2) won't work anymore but 3) too

    To put in a nutshell, I want to prevent that ( I want to force people to download the craftproxy client ) :
    Suggestions ?

    [​IMG]

    I think I can do it like in this subject :
    http://forums.bukkit.org/threads/craftbukkit-allow-only-ips-127-0.79229/
    PS : It won't work because
    without caching you have also a ip like 127.0.*.*

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 17, 2016
  9. Offline

    codezombie

    Just found this, and I got really excited about the caching, though it looks like it may no longer be functional. Is the following still true?

     
  10. Offline

    Mr Washington

    So when do you expect a release to be made? I need this feature to use with Transporter as soon as possible :)
     
  11. Offline

    Cannedbeefy

    I really hope it will work with spout sometime soon, Its to complicated for users to setup using the methods listed here.
     
  12. Offline

    Raphfrk

    I am on the Spout team, and I am thinking that what I might do is just have the Spout server have a "proxy mode". That would mean little extra coding for me. The Spout server can (or least will be) able to handle an encrypted connection. This would at least give the reconnect operation.

    All back-end servers would need to be in offline mode.
     
  13. Offline

    md_5

    Depending on what Raphfrk does I would --like-- to release my version of this program (which already works with 1.3)
    and ease the burden on him. However whether or not this can be done depends since it is an integral part of shadowraze.net and a couple of other very large servers.
    In the ideal world it would be kept private for a few weeks, but I guess nothing but time will tell.
     
  14. Offline

    Raphfrk

    That would be great. Your
    That would be great. Your version doesn't do caching, but that isn't going to be possible for 1.3 anyway.

    If you released yours, then that would save me having to update.

    It is still being discussed, but if Spout has an integrated proxy, then this program would likely still be more efficient. Spout is > 10MB, while this around a hundred kB.

    Well, that is an internal discussion, but I hope you guys decide to release it. A delay after each update is better than no software.
     
  15. Offline

    md_5

    1.3 version is 269.6kb and that includes BouncyCastle, Snakeyaml, GSON and probably one or two other things.
    Will chat to Cheezetarts about a delayed release :D
     
  16. Offline

    lol768

    Hi,

    I'm attempting to use this proxy for seamlessly reconnecting users to a running server on another port. When I kick the user (with message "[Reconnect] :127.0.0.1:25565" the downloading terrain message appears, but the user is kicked with message "[CraftProxyLiter] Protocol stream closed". The log in the console of the proxy displays:

    Code:
    [12:39:20 PM] My_IP/38447 (lol768): Kicked with: [Redirect] :127.0.0.1:25565
    [12:39:20 PM] My_IP/38447 (lol768): Redirect detected: 127.0.0.1:25565
    [12:39:20 PM] My_IP/38447 (lol768): Closed connection to server
    [12:39:20 PM] My_IP/38447 (lol768): Connecting to : 127.0.0.1 25565
    [12:39:20 PM] My_IP/38447 (lol768): Attempting to connect to: 127.0.0.1:25565
    [12:39:20 PM] My_IP/38447 (lol768): Connecting to: 127.0.0.1:25565 from 127.0.10.11
    [12:39:20 PM] My_IP/38447 (lol768): Connection successful
    [12:39:20 PM] My_IP/38447 (lol768): Connecting using proxy to server connection format
    [12:39:20 PM] My_IP/38447 (lol768): Server login successful
    [12:39:22 PM] My_IP/38447 (lol768): DownsteamBridge - EOF reached
    [12:39:22 PM] My_IP/38447 (lol768): Unable to flush output stream
    [12:39:22 PM] My_IP/38447 (lol768): Closed connection to server
    [12:39:22 PM] My_IP/38447 (lol768): Closed connection to client
    When I look at the server log for the server I'm trying to make it connect to, I see this:


    Code:
    12:39:09 [INFO] lol768 [/127.0.10.10:53604] logged in with entity id 146081 at ([world] 340.42738224132364, 72.0, 228.11704338807226)
    12:39:20 [INFO] Disconnecting lol768 [/127.0.10.11:54756]: Protocol error
    12:39:20 [INFO] Disconnecting lol768 [/127.0.10.11:54756]: Failed to verify username!
    I have auth_off on the proxy and online mode ON on the server. What am I doing wrong?


    Edit: I can confirm this works on an offline server (where names are not verified). A workaround would be to turn verify-names off on my servers and get the proxy to do it.
     
  17. Offline

    Raphfrk

    For reconnecting between servers, you have to have the backend servers in offline mode.

    The proxy cannot log in on behalf of a player in online mode, since it doesn't know the player's password.

    However, with auth_on, the proxy does exactly the same authing sequence as the standard server.

    The key point is to make sure that direct connections to your offline servers are no possible.
     
  18. Offline

    lol768

    Ok, this isn't an issue then, as I've made the servers inaccessible from outside (with online-mode set to false).
    I hope you don't mind me asking another question. When the client pings the server to receive player number info, it redirects the data to the port given as part of the arguments. Could you add a feature to allow this set to be configurable, so the MOTD, Player numbers and other data is requested from a separate port?

    I would do this myself, but the Bukkit team have closed the pull request to add this functionality without even explaining why. getting it to work would mean recompiling Bukkit and Craftukkit.
     
  19. Offline

    Raphfrk

    This software isn't really in active development any more.
     
  20. Offline

    _wilson_

    Does it still work tho? So many people need this!
     
  21. Offline

    Raphfrk

    Yes, it works at the moment. The next version includes encryption, so caching will not be possible.
     
  22. Offline

    md_5

    codename_B and I are looking at doing a collaborative :D
    Need to flesh out details, so don't get your hopes up.
     
  23. Offline

    lol768

    Sounds great if it can go ahead. As said, many servers are using this tool so this would be fantastic
     
  24. Offline

    TyrOvC

    I haven't looked at the builds of Minecraft 1.3 yet, but maybe encryption could be disabled from the server -> proxy then have the proxy do the encryption before it sends to clients.
     
  25. Offline

    Raphfrk

    Yes, that could be done, but it wouldn't help much.

    One option would be to have the players enter their passwords into the local version of the proxy.
     
  26. Offline

    lol768

    There's some info on the encryption protocol here: http://mc.kev009.com/Protocol_Encryption

    I don't know if it helps, but it would be fantastic if someone could update this so it could be used with 1.3

    Edit: Is there a client mod that supports the client redirection system? I know the spoutcraft client supports it, but I'd like to support people who don't wish to use SpoutCraft. Therefore, if this proxy cannot be updated, there is still a way in which I can seamlessly redirect players between servers.
     
  27. Offline

    Konkz

    Is this inactive? If yes, I can make a attempt of taking it over.
     
  28. Offline

    lol768

    Yes, I believe it is inactive, as per the comment of the developer:

    It would be fantastic if you could fork this. it seems as though it's unlikely to work without some modification to support the new encryption system. I only really need it for redirection between servers (kick messages are unencrypted).
     
  29. Offline

    codename_B

    KICK MESSAGES ARE UNENCRYPTED :O :O :O

    I'm looking forward to working with you, not looking forward to hacking my way around this one ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 17, 2016
  30. Offline

    lol768

    The reason I think they are is because the wiki states:
    That might be wrong though
     
  31. Offline

    codename_B

    They may be encrypted post-join though.
     

Share This Page