Gamma is a reverse-TCP proxy for Minecraft networks implemented in Python using the Socket
package. Gamma supports multiple client connections to multiple servers. Players are proxied to the respective server depending on the hostname included in the first connection packet.
Join our Discord Server!!
Proxy Protocol
proxy protocol v1
heading to the server to forward player IPsMultiple Players
Multiple Servers
Highly Customisable
Connection
class, there are functions that get called when events happen. Here are a list of the current events that are triggeredon_player_ping
on_invalid_hostname_ping
on_player_connect
on_player_disconnect
on_server_offline
Additionally to all of this, we also have a bandwidth counter, self.conn_bandwidth
which counts the total amount of bytes sent and received from the upstream
(server) or the downstream
(player) connection.
I would have to say that the biggest inspiration for this project would have to be infrared by haveachin
proxy-protocol
is enabled, the server that the players will be proxied to has to be able to understand and read the proxy protocol header. Without this, the server can't understand the packet and drops it. If you're using Waterfall
, you can turn set proxy-protocol: true
in config.yml. Other server types normally have plugins to parse this kind of data.requests
, json
main.py
file, run python3 main.py
and watch the magic happen!Variable | Type | Description |
---|---|---|
self.upstream_conn | Socket Object | The Socket object that contains the connection between the server and the proxy |
self.downstream_conn | Socket Object | The Socket object that contains the connection between the player and the proxy |
self.downstream_address | Tuple | A tuple that contains the players ip and port in the format (ip: str, port: int) |
self.conn_alive | Boolean | Determines whether the connection is active or disconnected, True = Connected , False = Disconnected |
self.upstream_packet_count | Integer | The total number of packets transferred, from Server to Gamma |
self.downstream_packet_count | Integer | The total number of packets transferred from Player to Gamma |
self.downstream_bandwidth | Integer | The total amount of bytes proxied from the downstream connection |
self.upstream_bandwidth | Integer | The total amount of bytes proxied from the upstream connection |
self.conn_hostname | String | The hostname that the player has connected to from their server list |
self.player_username | String | The username of the proxied player, can be None if a username isn't detected |