Dockercraft - A simple Minecraft Docker client, built using Cuberite !
#1
I just stumbled upon this project made by the Docker team while browsing Github's "Explore" page, and I thought that it was a neat thing. It is a Docker client that uses Minecraft as an interface to manage the virtual machines. So I read the README and I found that it is built using Cuberite. Link: https://github.com/docker/dockercraft#how-it-works
I think it is pretty amazing that they managed to communicate with Docker from the server, even if they needed to use a hack with the WebTabs to communicate with the plugin
Reply
Thanks given by: PCPlayerLV
#2
Actually, i do believe the hack isn't necessary anymore - we do have the network api.
Reply
Thanks given by: PCPlayerLV
#3
The webadmin has the added value that it provides HTTP parsing. If the Docker interface is using any form of HTTP, it would mean that they need to re-implement HTTP parsing on top of cNetwork API, which is not a simple task, the webadmin hack would make sense in such a case.
Reply
Thanks given by: PCPlayerLV
#4
We could build a cHTTPParser interface which could be used by the webadmin but also by any other plugin using the cNetworkAPI
Reply
Thanks given by:
#5
It shouldn't be too hard to do in Lua right?
--[[ Request header is something like this:
GET / HTTP/1.0
Host: cuberite.org
Other-Stuff: Info for other stuff
More-Stuff: Even more stuff
]]

local Headers = StringSplit(RawRequest:match("^.-\r\n\r\n"), "\n")
local PostInformation = StringSplit(Headers[#Headers], "&"):sub(2) -- Post starts with a question mark.
Reply
Thanks given by: PCPlayerLV
#6
Don't forget that the receive calls are asynchronous, you need to cache the response (or leftovers from it) between calls. And you need to know if you're still parsing the headers, or the body.
Reply
Thanks given by: PCPlayerLV




Users browsing this thread: 1 Guest(s)