Skip to content

Support always-listening / always-monitoring (remote mc server) #2

@javabrett

Description

@javabrett

Currently mcPortKnock implements a:

  • monitor (real mc server is running, detect idle and run stopCommand) ->
  • listen/be-fake-mc-server (port knock listener and run startCommand on client join-server knock) ->
  • monitor etc.

... loop. This is ideal when mcPortKnock runs on the same server as Minecraft and would typically listen on the same TCP port, so both mcPortKnock and Minecraft can't listen simultaneously.

mcPortKnock can actually work quite well already in a different scenario, where it runs on a different server to the Minecraft server it monitors. In this case, mcPortKnock can run on a tiny server with startCommand and stopCommand controlling a remote mc server running on bigger hardware, which can then be completely shutdown when idle, since it isn't hosting mcPortKnock.

In this scenario, an enhancement would be for mcPortKnock to always-listen e.g. 25565/tcp, since it won't ever have to yield that port for a local real mc server. Additionally, it can always-monitor, allowing it to stopCommand the mc server when it is idle, even when it is in "listen" mode, where currently I don't expect it would be monitoring mc or expect it to be running.

If implemented, this enhancement could improve tiny/off-mc-host mcPortKnock to improve responsiveness and avoid any out-of-sync states where mc is not shutdown when idle.

Networking for above usage: there are a number of great ways to incorporate mcPortKnock as a port-knock with mc-direct when running - I've used DNS with health-checks and failover rules, but other DNS and load-balancing options also work.

Thanks for the nifty utility and project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions