From af53f854f8910584e1e8a7db2786cf1f330ab8a0 Mon Sep 17 00:00:00 2001 From: bartek szabat Date: Tue, 29 Oct 2024 11:58:11 +0100 Subject: [PATCH] run in docker-compose: open prismarine viewer ports: update readme --- README.md | 2 ++ docker-compose.yml | 9 ++++++++- services/viaproxy/README.md | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 services/viaproxy/README.md diff --git a/README.md b/README.md index 414887c..018d144 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ When running in docker, if you want the bot to join your local minecraft server, "host": "host.docker.internal", // instead of "localhost", to join your local minecraft from inside the docker container ``` +To connect to an unsupported minecraft version, you can try to use [viaproxy](services/viaproxy/README.md) + ### Online Servers To connect to online servers your bot will need an official Microsoft/Minecraft account. You can use your own personal one, but will need another account if you want to connect with it. Here are example settings for this: ```javascript diff --git a/docker-compose.yml b/docker-compose.yml index 0bef712..b37cef5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,5 +7,12 @@ services: volumes: - .:/app command: node main.js + + viaproxy: #use this service to connect to an unsupported minecraft server versions. more info: ./services/viaproxy/README.md + image: ghcr.io/viaversion/viaproxy:latest + volumes: + - ./services/viaproxy:/app/run ports: - - "3000-3003:3000-3003" + - "25568:25568" + profiles: + - viaproxy diff --git a/services/viaproxy/README.md b/services/viaproxy/README.md new file mode 100644 index 0000000..5a9f0cc --- /dev/null +++ b/services/viaproxy/README.md @@ -0,0 +1,25 @@ +Use this service to connect your bot to unsupported minecraft server versions. + +Run: + +```bash +docker-compose --profile viaproxy up +``` + +After first start it will create config file `viaproxy.yml` in this directory. + +Edit this file, and change your desired target `target-address`, + +then point to your `settings.js` `host` and `port` to viaproxy: + +```javascript + "host": "host.docker.internal", + "port": 25568, +``` + +This easily works with "offline" servers. + +Connecting to "online" servers involves more configuration: see `auth-method` in `viaproxy.yml` (TODO describe) + + +