Coder Social home page Coder Social logo

infrared's Introduction

Infrared

An ultra lightweight minecraft reverse proxy and idle placeholder: Ever wanted to have only one exposed port at your server for multiple minecraft servers? Then infrared is the tool you need! Infrared works as a reverse proxy using a subdomains to connect clients to a specific minecraft server.

Features

  • Reverse Proxy
  • Display Placeholder Server
  • Autostart Server when pinged
  • API for logging via InfluxDB
  • gRPC API for live data

Installation

Build it yourself

  • Download the latest release of this repository.
  • You need Go.
    Download it here or with your favorite packet manager.

After that navigate in the project folder and pull all dependecies:

go get -u

Now you can just build it:

go build ./cmd/infrared

or install it:

go install ./cmd/infrared

Download a build

Just download a build from here and your good to go.

Environment Variables

!!Flags override environment variables!!
INFRARED_ADDRESS is the address that the proxy listens to
INFRARED_CONFIG_PATH is the path of all your server configs

Flags

!!Flags override environment variables!!
--address is the address that the proxy listens to [default: ":25565"]
--config_path is the path of all your server configs [default: "./configs/"]

Example Usage

./infrared --address ":8080" --config_path "."

Example Config for a Vanilla Server

DomainName: "mc.example.com"
ListenTo: ":25565"
ProxyTo: ":8080"
DisconnectMessage: "Sorry §e$username§r, but the server is §osleeping§r right now."
Timeout: "13m37s"
Command: "java -server -Xmx512M -jar minecraft_server.jar nogui"
Docker:
    ContainerID: "4c01db0b339c"
    Portainer:
        Address: "localhost:9000"
        EndpointID: "1"
        Username: "admin"
        Password: "foobar"
Placeholder:
    Version: "1.14.4"
    Protocol: 498
    Icon: "/path/to/icon.png"
    Motd: "Server is currently sleeping"
    MaxPlayers: 20
    PlayersOnline: 2
    Players:
        - Name: "Steve"
          ID: "8667ba71-b85a-4004-af54-457a9734eed7"
        - Name: "Alex"
          ID: "ec561538-f3fd-461d-aff5-086b22154bce"

DomainName is a fully qualified domain name
ListenTo is the address that the proxy listen to for incoming connections not implemented yet
ProxyTo is the address that the proxy sents the incoming connections to
DisconnectMessage is the text that gets diplayed as reason for the disconnect (use $username when you want to use their username)
Timeout is the duration befor it will be shut down
Command is the command that start the minecraft server

Only used if the Command is not present
Docker is a data object that represents a docker interface.

  • ContainerID is the ID of the container that contains the minecraft server
    Only needed if you are using Portainer for user privilege management
  • Portainer is a data object that represents a portainer interface
    • Address is the address of the portainer instance
    • EndpointID is the id of the docker endpoint
    • Username is the username for the portainer user
    • Password is the password for the portainer user

Placeholder is a data object that represents a SLP response from a vannila minecraft server

  • Version is the minecraft version diplayed with the placeholder
  • Protocol is the version number of the protocol that is used
  • Icon is the path to the icon image that is diplayed on the client side
  • Motd is the Motd of a minecraft server
  • MaxPlayers is the maximum of players that can join the minecraft server
  • PlayersOnline is the amount of players that are online currently on the server
  • Players is an array of players that are shown on the client side when hovered over the player count
  • Name is the player name displayed
  • ID is the UUID of the player (importent for the player head that is diplayed next to the name)

infrared's People

Contributors

haveachin avatar

Forkers

spursf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.