run in docker-compose: added viaproxy service to connect to unsupported minecraft versions

This commit is contained in:
bartek szabat 2024-10-29 11:58:11 +01:00
parent 2ee94d7b60
commit 62550aa2c8
3 changed files with 35 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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)