Coder Social home page Coder Social logo

haveachin / infrared Goto Github PK

View Code? Open in Web Editor NEW
690.0 13.0 60.0 14.59 MB

An ultra lightweight minecraft reverse proxy and idle placeholder

Home Page: https://infrared.dev

License: GNU Affero General Public License v3.0

Go 98.71% Dockerfile 0.47% Makefile 0.82%
minecraft-server proxy minecraft go lightweight placeholder docker reverse-proxy vanilla modded

infrared's People

Contributors

4kills avatar base2code avatar cube-builder avatar dependabot[bot] avatar doublecheck0001 avatar flogamermc avatar haveachin avatar kstruempf avatar lhridder avatar mb175 avatar realdragonium avatar snowpmakes avatar tigattack avatar vorburger avatar xiaoxiaosn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infrared's Issues

Add windows 10 support

Is your feature request related to a problem? Please describe.
inferred dosent support windows 10"

Describe the solution you'd like
Add support for windows 10

Describe alternatives you've considered
Use .exe

Additional context
Docker is not in windows 10

Send a generic status response if the domain is not a valid proxy

Describe the solution you'd like
It would be useful to have a global config where you can specify what status response should be sent if a client tries to connect to an invalid proxy.

Example/default config:

"invalidProxy": {
    "versionName": "infrared",
    "protocolNumber": 1,
    "motd": "There is no proxy associated with this domain. Please check your configuration."
  }

Example server list view:
image

Suggestion: load balancer

Sorry if I keep making issues but I am wondering if you will ever had a load balancing to this proxy just like NGINX does

Support for wildcard proxies?

Support for something like *.domain.example would be useful in the domainName field. This would allow for sending all requests on a particular subdomain to a separate router. An example of where this might be practical is a multi-box server setup with a raspberry pi/etc acting as a router for different servers.

Multi-Proxy grafana panel

Hello,

I just wanted to know if there is a way to configure the Grafana panel to show information from all proxies.

Cheers,

Mitch

Version-switching

I don't know if this is already added. If it is please just close this issue. I just wanted to ask, if you could add a way for redirecting the player to different servers depending on his minecraft version. For Example: When I join with my 1.8 instance on my server, which runs 1.16 I will get kicked and If I do the same with my 1.16 instance for a 1.8 server I will get kicked too. Is there a way to automatically redirect 1.8 players to the 1.8 server and 1.16 players to the 1.16 server?
Sincerely yours,
Trqhxrd

Server always sleeping

Hi,
sadly I can't use the proxy because I always get this error message when trying to connect to the minecraft server:
Could not determine if the container is running error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" connection=xx.x.xx.xxx:51925 destinationAddress=:25566 domainName=xxx.ddns.net event=Error gate=:25565
I made the container using the docker-compose file from this git repo.

Make an video tutorial on setting up infrared

Is your feature request related to a problem? Please describe.
Im new to infrared and I dont understand it.

Describe the solution you'd like
Make an tutorial on infrared for windows 10!

Describe alternatives you've considered
A clear explantion and setup guide on infrared

Additional context
I need help how it works on an video tutorial

Issue with captolizations

Hi I noticed that if someone connects to the server using EXAMPLE.COM or Example.com instead of example.com they will not be able to connect to the server. Unless they use example.com

Infrared container is stuck in a boot loop

I believe I set it up incorrectly, or I put the config file in the wrong place or I maybe named it the wrong thing?

root@droplet901-12:/# docker start -i infrared
2021/03/15 06:21:57 Loading proxy configs
2021/03/15 06:21:57 Starting Infrared
2021/03/15 06:21:57 Gateway exited; error:no proxies in gateway

It will continue to restart because of this error, unfortunately my google-fu didn't help me with this error either.
Could you make a Tutorial for people with about 5 minutes of docker experience? Thanks!

More descriptive documentation/README?

Hello! The README is a bit ambiguous on the first read-through. It seems, according to the config variables, that Infrared expects there to be a minecraft server running in a Docker container, and that's what the proxy points to. Is that true?

Also, if people would like to contribute, creating a CONTRIBUTING.md file or just putting it in the README would be helpful.

Specify proxy bind ip

Is it possible to bind only the proxy -> main server to a different ip?

For example, we have a non ddos protected ip and a ddos protected ip and we would like to connect to the backend with the non protected ip, and want players to connect to the proxy through the protected ip. Is this possible?

TImeout config

Is there a more elegant way of disabling the Timeout then putting it up an insanley high amount?

IP forwarding & Callback

Hey,

I recently installed Infrared by using the docker install link in the README.md, and I've been having issues getting the HAProxy IP-forwarding to work & Callbacks.

The issue with the IP Forwarding is when I enable the proxy_protocol in Bungeecord and proxy in Infrared, every time I join I instantly get kicked with no error and just a black kick message. The bungeecord also fails to see me connecting.

The issue with Callback is that when I use the example off of the full config example and enter my own URL, it never receives any POST requests, even when added into the config as shown in the example.

Have you got any idea why this doesn't work?

Thanks,
Nathan

Contact

Hello again!

I'm extremely close to having my project, and just need help with one thing.

Is there any chance that you have discord? If you do, please add me, Mitch#0007

Cheers,

Mitch!

no connection to docker server

hello,
i recently installed infrared on a testsystem with two minecraft server in docker. However there is no connection between them. Everytime when i try to connect to a subdomain i get the error "Hey username! The server was sleeping but it is starting now."

grafik

proxy-protocol with velocity not working

I've enabled proxyProtocol for a server, and on the velocity side proxy-protocol is enabled, however when connecting I get:

Internal Exception: io.netty.handler.codec.DecoderException: java.io.IOException: Bad packet id 10

on the clientside, and:

2021/03/24 18:48:57 [>] Incoming 192.168.1.1:60116 on listener :25565
2021/03/24 18:48:57 [i] 192.168.1.1:60116 requests proxy with UID velocity1.<domain>@:25565
2021/03/24 18:48:57 [i] 192.168.1.1:60116 with username endigma_ connects through velocity1.<domain>@:25565
2021/03/24 18:48:57 [x] 192.168.1.1:60116 closed connection with :25565

on the infrared proxy. this exact setup works with proxy-protocol enabled in both places, but this is undesirable.

Bug when connect with Forge

client will send the server address like mc.example.com.\x00FML\x00, which is not configureable in config file.

Home Assistant Addon support

Hi, I recently found out about this project and I was wondering if someone would care to add support for adding this project as an addon to home assistant.

Here's an example on how this could potentially be done.

I would've loved to do this myself, but I have 0 knowledge regarding docker.

If this isn't something anyone is interested in then that's fine as well feel free to close this issue is that's the case.

When running the windows 10 86x infrared.exe it closes after an second

Describe the bug
When running the windows 10 86x infrared.exe it closes after an second

To Reproduce
Windows 10
Beta 1.1.1v
I didnt do anything
I ran the exe files

Expected behavior
Run infrared program

Screenshots (Optional)

2021-07-18.18-54-00.mp4

Additional context (Optional)
Can I get some help?

Server always showed as sleeping

Every time i try to connect it shows the disconnect message.
Compose:

version: '3.3'

services:
  infrared:
    image: haveachin/infrared:latest
    container_name: "infrared"
    restart: "unless-stopped"
    stdin_open: true
    tty: true
    ports:
      - "25565:25565/tcp"
    volumes:
      - "/opt/infrared/configs:/configs"
      - "/var/run/docker.sock:/var/run/docker.sock"
    expose:
      - "25565"
    environment:
      INFRARED_DEBUG: "true"
      INFRARED_COLOR: "false"
      INFRARED_CONFIG_PATH: "/configs"
    links: 
      - mcatm6
      - mcval3mod
      - mcvanilla

config:

DomainName: "mc.example.com"
ProxyTo: ":25566"
Docker:
  ContainerName: /mcvanilla
Server:
  Version: "1.16.4"

TCP connection forwarder.

Hello :)

I'm currently using this as DDoS protection for a few servers, my only problem is that there is a bandwidth cap of 750GB per proxy.

I currently have multiple A records as an attempt to spread the load between my proxies, but is quite inefficient as one more usage than the other.

If it were possible to have a TCP connection forwarder that can send the hostname in a header to infrared, that would be amazing! If that is working, I could turn it into a load balancer :)

Thanks,

Mitch, AusGuard.net

Reading new/deleted server configs

Hey, sorry for making another one of these,

I just wanted to know if it would be possible to reload all configs on a set interval?

My current file propagation method deletes the config, and send the updated one. I can't recall if it is the original infrared, or our fork, but we were able to check for changes in a config. With my new system in place, I have to restart every proxy in order to propagate the changes as it is a whole new file, not the same one.

Another thing that would be nice, is if we could check for configs that have been added/removed upon a set interval. This ensures ZERO downtime while players are on the proxy :)

Thanks,

Mitch, AusGuard.net

IP forwarding

Ip forwarding on Bungeecord

How can I make the Bungeecord receive the player's ip? I noticed that when a player logs in from bungeecord, he gets the server ip and not the real one.

Thank you! 🌵

TCPShield Plugin 2.5 not supported

Describe the bug
TCPShield Plugin throws an exception when a client joins from a remote network.

To Reproduce
Spin up an Infrared proxy with "realIp": true and proxy the traffic to a server running TCPShield Plugin 2.5.
In the TCPShield Plugin config set debug-mode: true and add 127.0.0.1/32 at the bottom of the tcpshield-ips.list file.
Connect through Infrared to the server from a remote network (the client joining the server must have a valid public IP address). This is important due to how the TCPShield Plugin handles local connection.

You should now be able to see this in the server log:

[TCPShield] Debug : unknown[unknown/null] was disconnected because no proxy info was received and only-allow-proxy-connections is enabled. Raw payload = "example.com///123.4.567.89:12345///1621048346"

Expected behavior
Client should be able to connect to the server and his "real" IP should be passed through.

Additional context (Optional)
TCPShield Plugin 2.5 code that causes the exception:
https://github.com/TCPShield/RealIP/blob/master/src/main/java/net/tcpshield/tcpshield/TCPShieldPacketHandler.java#L106

Configs do not update instant when adding a new server

Hi, everytime I add a server to infrared it does not instantly update and I have to restart the docker container everytime which is annoying as everyone gets kicked off.

2021-02-23T17:58:13Z INF Unknown address requested connection=someonesip:34458 gate=:25565 requestedAddress=openanarchy.org:25565

OS: Debian 10

The backend server is online as I tested it with an nginx tcp proxy and haproxy and I was able to join the server fine.

I am also using the latest version of infrared.
My suggestion is to add some sort of reload command like nginx.

Adding a simple frontend

Is your feature request related to a problem? Please describe.
I love infrared proxy, but sometimes it is "hard" to go and ssh into the server running infrared, and it would be easier if it had a simple WebUI, like Nginx Proxy Manager, but simpler.

Describe the solution you'd like
I would like it if you added a simple WebUi for adding hosts, modifying, and deleting them. Just a simple Add connection → From → To → Save.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
image
Something like this would be more than enough(without access control, and other web-related proxying), also add a tab where you could directly edit the code.

Infrared not showing offline message when on tcpshield

Describe the bug
Hi, I'm having some trouble with my infrared proxy. I have a it like this domain.??.org -> proxy.1b1e.org -> tcpshield.com -> infrared proxy (my end) -> server. But when I turn off the server it should show an offline message but instead it shows
"Can't connect to server" at the MOTD and when trying to connect to the server it says "Disconnected."
To Reproduce
What OS are you using?
Windows_10_infrared_x86_64
{
"domainName": "1b1e.org",
"listenTo": ":25565",
"proxyTo": "XD:25588",
"proxyProtocol": false,
"realIp": true,
"timeout": 1000,
"disconnectMessage": " §b{§3JamesShield§b} \n\n §cSorry {{username}, {{domain}} is offline! \n\n§3Please try again later.",
"offlineStatus": {
"versionName": "§b{§3JamesShield§b}",
"protocolNumber": 1,
"maxPlayers": 0,
"playersOnline": 0,
"motd": "§b{§3JamesShield§b} &cThis server is offline, Please try again later."
}
}
I put the infrared proxy with tcpshield

Expected behavior
Show the offline motd and offline message when connecting

Screenshots (Optional)
image
image

Additional context (Optional)
How do I fix this?

Callback setting specific to errors

Additional setting for callback URLs according to errors
Callback should be capable of alerting at a specified error level and / or error count

Can no build on CentOS 8

Hi guys i can not run the docker file.

Error at the line 6:

Step 6/14 : RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /main .
---> Running in be20dbc8ce2c
go: github.com/Microsoft/[email protected]: Get "https://proxy.golang.org/github.com/%21microsoft/go-winio/@v/v0.4.14.mod": dial tcp: lookup proxy.golang.org on 1.1.1.1:53: read udp 172.17.0.2:41831->1.1.1.1:53: read: no route to host
The command '/bin/sh -c CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /main .' returned a non-zero code: 1

Add an option to disable shutting down docker containers

Is your feature request related to a problem? Please describe.
I would like the proxy to start the server's docker container when it's offline and someone tries to connect but not turn it off when they disconnect.

Describe the solution you'd like
Add an option under the docker group along the type of onlyStartup that would disable shutting the server down by stopping the container, while maintaining the startup functionality.

Describe alternatives you've considered
None.

Additional context
This is would give us the option to stop the server with a plugin or mod which can take more conditions into consideration, like shutting down after no players have been online in 24 hours. This could also be a solution to the server shutting down while players with a direct connection are still online.

Prometheus Exporter

I launched Infrared on 5 servers and I think many who use Prometheus + Grafana would find it very useful to see the statistics.
Personally, I need the following data:

  • CPU and RAM load
  • How many players are connected through the domain server1.exaple.com, server2.example.com, etc. and total connections
  • If possible, display a list of these players (Nicknames)

Not possible to accept direct ip connections

When players are trying to connect to the ip instead of the domain name, they are getting disconnected with an error. It would be nice to be able to disable domain checking in the config

Spamming console with silly message given context

The application spams the console with "x did not respond to ping; is the target offline?" when it should know whether or not the target is offline because these servers are managed by infrared's docker functionality?

Useless spam in the logs.

Portainer in HTTPS mode not supported

Describe the bug
Portainer configured to use HTTPS connections will drop all HTTP traffic. Infrared tries to connect over HTTP.

To Reproduce
Docker and Portainer configured in the server instance config. Portainer is configured to use SSL. Error:
____:___ closed connection with :25565; error: Get "http://____.com:9000/api/endpoints/1/docker/v1.24/containers/json?all=1&limit=0": context deadline exceeded

Trying this request URL with curl, or trying to visit Portainer over HTTP in general gives the following error:
Client sent an HTTP request to an HTTPS server.

Expected behavior
Automatically redirect to HTTPS when required.

I think the easiest solution would be to allow users to add http:// or https:// to the portainer adress config option, with it defaulting to http if not specified.

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.