rocket protocol client
Project description
rocket protocol
rocket it's the safer and text-based twin brother of RCON protocol targeted mainly for executing commands on game servers
What is the Rocket protocol?
Rocket protocol works on the same principle as RCON, that is, it allows remote execution of commands on the server. The communication between the client and the server is text-based, using the TCP protocol. Unlike RCON, the Rocket protocol encrypts all communication between the client and the server using an encryption key that is generated when this protocol is configured on the server (the client version must encrypt its packets with the same key as the server version).
Supported games servers
Further implementations of the protocol of various games will be available on other branches, such as implementation/minecraft
- Soon implementation of the Minecraft game will be available
NOTE: main branch contains only client implementation written in python, for other implementation see branches.
What does the Rocket packet look like?
A Rocket packet has three parts, which are:
<request_id>;<p_type>;<body>
request_id
is a unique identifier for the request, and it can be used to identify the response.packet_type
is the type of the packet.body
is the actual content of the packet.
It is important to note that the server and the client should validate the count of ;
in payloads, and there should be a maximum of two.
Here are the types of packets supported by Rocket Protocol:
class RPacketType:
SERVER_RESP_SUCCESS: int = 0
SERVER_RESP_FAILURE: int = 2
SERVER_AUTH_FAILURE: int = 3
CLIENT_REQUEST: int = 5
How to use rocket python client
Below is a simple example of how to send commands to the server.
from rocket import Rocket
from rocket.packet import RPacketType
if __name__ == "__main__":
rocket: Rocket = Rocket('localhost', 5543, "rUc_HJItDCwdkZ0esm8uKUh4yIc8GsYSTNFQleUcmI0=")
response: RPacket = rocket.execute_command("say hello")
if response.p_type == RPacketType.SERVER_RESP_SUCCESS:
print("SERVER SUCCESS RESPONSE")
command: str = "give @a potion{Potion:\"minecraft:night_vision\"}"
response: RPacket = rocket.execute_command(command)
print(response)
NOTE: The key that encrypts the connection is not a random string, to generate the key you need to use the command::
python -c "\n\nimport base64, os\nprint(base64.urlsafe_b64encode(os.urandom(32)).decode('utf-8'))"
Advantages of using the Rocket protocol
The Rocket protocol offers several advantages over other remote execution protocols like RCON:
-
Enhanced Security: The Rocket protocol encrypts all communication between the client and the server, making it more secure than RCON, which sends all data in plain text. The encryption key is generated when the protocol is configured on the server, and the client must use the same key to encrypt its packets. This ensures that only authorized clients can communicate with the server.
-
Text-based Communication: Rocket protocol uses text-based communication, which makes it easier to read and debug than binary protocols. Text-based communication also means that the protocol can be used with any programming language that supports TCP sockets.
-
Multiple Language Compatibility: The Rocket protocol is compatible with multiple programming languages, making it easy to use with different types of clients and servers. This means that developers can use their preferred programming language to create clients that can communicate with Rocket-enabled servers, and vice versa.
-
Flexible Packet Structure: The packet structure of the Rocket protocol is simple and flexible. It consists of three parts, and the packet type can be easily extended to support new features. This makes it easy to add new functionality to the protocol without breaking compatibility with existing clients and servers.
Overall, the Rocket protocol offers a secure, flexible, and easy-to-use alternative to other remote execution protocols like RCON.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rocket-client-0.1.0.tar.gz
.
File metadata
- Download URL: rocket-client-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa3b339920c4903d7d03486ca2d2bd88a19f077539c71ae64fccc6e8833d7fa |
|
MD5 | f9f32e99597c7cc023c20ca9634cbc15 |
|
BLAKE2b-256 | e6fb73d628c3d4eee9327ac635e86f886342607471d13271656c737af14c8dbb |
File details
Details for the file rocket_client-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: rocket_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b187f5d32780f061acb41134c5e8577b9c83276a6e68dc78e64a126b965a5663 |
|
MD5 | c017c303644fdfd0388aeb09565be322 |
|
BLAKE2b-256 | 6fcdd2c6a1fda5608229767f7ba3d01009c5c7f1c3e67db3f598502a68e685b1 |