Page 3 of 5

Re: Add SRV Record support

Posted: Wed Nov 13, 2019 2:39 pm
by Chrischhan
Are there any news on this Topic? Any Dev on this?

Re: Add SRV Record support

Posted: Tue Nov 19, 2019 2:17 pm
by movax20h
+1 SRV support would be great to have so no need to mess manually with ports. And easier to host multiple servers on the same machine with same IP, but different ports, yet still use different DNS names for them. Ports would be discovered via SRV.

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 5:46 pm
by Railgunning
+1, I host for a let's say...easily confused...group of friends. This would streamline things :)

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 8:41 pm
by ssilk
I’m not very deep into that, but wouldn’t this be possible with Docker? Create Docker Image for Factorio and let it run twice. Networking the containers should then be simple.
Just quick googling:
https://hub.docker.com/r/dtandersen/factorio/
https://hub.docker.com/r/goofball222/factorio/

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 8:44 pm
by chris13524
ssilk wrote:
Thu Jan 30, 2020 8:41 pm
I’m not very deep into that, but wouldn’t this be possible with Docker? Create Docker Image for Factorio and let it run twice. Networking the containers should then be simple.
Just quick googling:
https://hub.docker.com/r/dtandersen/factorio/
https://hub.docker.com/r/goofball222/factorio/
Issue is you have one public IP with multiple Factorio instances. You need the ability to route based on hostname to one of each container. Be that with an ingress server (like HTTP does with the Host header) or with an SRV record to tell the Factorio client which port to connect over.

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 9:41 pm
by ssilk
The Docker container does that for you. The image internally connects to the same ip in both images.
Of course it’s not so simple as if there is a SRV-record, never did that, but I’m sure its possible...

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 9:46 pm
by Gellis12
The docker container can put the two instances on different ports, but it can't make them both share the same ip and port.

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 9:50 pm
by chris13524
ssilk wrote:
Thu Jan 30, 2020 9:41 pm
The Docker container does that for you. The image internally connects to the same ip in both images.
Of course it’s not so simple as if there is a SRV-record, never did that, but I’m sure its possible...
If what you're suggesting works, I would be very happy.

Would you mind posting a working docker-compose.yml that demonstrates your solution?

Re: Add SRV Record support

Posted: Thu Jan 30, 2020 10:16 pm
by ssilk
Sorry, this evening iPad only. :? :roll:

Re: Add SRV Record support

Posted: Sun Feb 02, 2020 10:48 pm
by chris13524
ssilk wrote:
Thu Jan 30, 2020 10:16 pm
Sorry, this evening iPad only. :? :roll:
Any update on a working docker-compose.yml? I'm interested in your solution

Re: Add SRV Record support

Posted: Mon Feb 03, 2020 8:46 pm
by ssilk
You should ask someone who is more informed than me. 8-) Eventually ask here for example https://www.reddit.com/r/docker/

On the other hand the best way to do it is learning it yourself.
I would look for a good example. This looks good: https://hub.docker.com/r/factoriotools/factorio/
Actual 0.18-release: Check.

And from here I would try to understand it and extend it for my needs. Eventually I would ask the author - mybe he/she is interested to include that.

Re: Add SRV Record support

Posted: Mon Feb 03, 2020 8:52 pm
by chris13524
ssilk wrote:
Mon Feb 03, 2020 8:46 pm
You should ask someone who is more informed than me. 8-) Eventually ask here for example https://www.reddit.com/r/docker/

On the other hand the best way to do it is learning it yourself.
I would look for a good example. This looks good: https://hub.docker.com/r/factoriotools/factorio/
Actual 0.18-release: Check.

And from here I would try to understand it and extend it for my needs. Eventually I would ask the author - mybe he/she is interested to include that.
Ok, well I have very extensive experience with Docker and I can tell you with high degree certainty that Docker does not solve the problem that we need SRV records to address. I asked since you said you were "sure its possible" :)

Re: Add SRV Record support

Posted: Mon Feb 03, 2020 9:21 pm
by ssilk
Hm :roll: so I "took my mouth too full", how we say in German. Sorry for that, I normally use that only and do not configure it. But I know, that we use somewhere two MySQL docker containers (one for read, the other for readwrite). Both run on one host. And that looked for me too similar, so that I thought this must work also for a game. Maybe it's Kubernetes, that does this magic?

I really don't know and as you ask me I think I should know, how this works, so I will ask.

Re: Add SRV Record support

Posted: Tue Mar 03, 2020 7:15 pm
by redlabel
+1 someone came to our discord asking for this and it is a good idea if it's not too hard to do. We could have for example bb.getcomfy.eu for biter battles and so on.

Re: Add SRV Record support

Posted: Tue Jun 09, 2020 2:07 pm
by de_w
+1 to srv records, if not to much of an effort with 1.0 coming up.

Re: Add SRV Record support

Posted: Wed Dec 02, 2020 4:24 pm
by ModProg
+1 Would be really helpful for having Server Addresses People can remember ;)

Re: Add SRV Record support

Posted: Fri Dec 04, 2020 4:39 am
by ssilk
I still think this is simple port forwarding inside of a kubernetes cluster or similar or Docker can do this meanwhile itself. Nothing which needs to be part of Factorio.

Re: Add SRV Record support

Posted: Fri Dec 04, 2020 5:38 am
by robot256
ssilk wrote:
Fri Dec 04, 2020 4:39 am
I still think this is simple port forwarding inside of a kubernetes cluster or similar or Docker can do this meanwhile itself. Nothing which needs to be part of Factorio.
I don't see why anyone would learn and run an entire container cluster for this simple feature. But maybe there is another way around it. The second answer to this stackoverlow post suggests nginx as a means to route traffic entering on a single port to different ports based on which subdomain they can from. It does mean the nginx process has to touch every packet going to every server instance, so there can be a bottleneck & extra latency. SRV records ensure the performance is the same as directly specifying IP:port.

Re: Add SRV Record support

Posted: Fri Dec 04, 2020 5:55 am
by Gellis12
ssilk wrote:
Fri Dec 04, 2020 4:39 am
I still think this is simple port forwarding inside of a kubernetes cluster or similar or Docker can do this meanwhile itself. Nothing which needs to be part of Factorio.
To expand on what I said earlier in the thread, these are both solutions for running multiple servers on the same host, listening on different ports (which is easy to do without using docker, I might add).
These tools will not allow users to connect to factorio1.example.com and factorio2.example.com; the user will still need to specify port numbers for at least one of the factorio servers, since multiple processes on the same host cannot listen on the same port.
What an SRV record would accomplish, is automatically telling the client which port to connect to based on the requested subdomain (ie, factorio1.example.com would point to 1.2.3.4:101 and factorio2.example.com would point to 1.2.3.4:102)
Furthermore, since SRV records are at the DNS level, there would be no additional bandwidth bottleneck or added latency from using a proxy server to attempt to accomplish this.

Re: Add SRV Record support

Posted: Sat Dec 05, 2020 8:22 am
by ssilk
@robot256: have you seen the post date? 2017. It might be - I’m not an expert - that there where changes meanwhile. Just my usual stackoverflow habits. :)
Gellis12 wrote:
Fri Dec 04, 2020 5:55 am
To expand on what I said earlier in the thread, these are both solutions for running multiple servers on the same host, listening on different ports (which is easy to do without using docker, I might add).
These tools will not allow users to connect to factorio1.example.com and factorio2.example.com; the user will still need to specify port numbers for at least one of the factorio servers, since multiple processes on the same host cannot listen on the same port.
What an SRV record would accomplish, is automatically telling the client which port to connect to based on the requested subdomain (ie, factorio1.example.com would point to 1.2.3.4:101 and factorio2.example.com would point to 1.2.3.4:102)
Furthermore, since SRV records are at the DNS level, there would be no additional bandwidth bottleneck or added latency from using a proxy server to attempt to accomplish this.
Ok, understood, thank you. Well, ok, that makes kind of sense now. My mistake was, that I’ve always seen this from the internal routing sight, I mixed some things up.

I have a question at this point: when you run two Factorio servers at one host, who or what decides which will receive which packet when the incoming packet is for the same target port? Is that be done by the operating system? I mean: there must be something “above” the two Factorio servers, which does the routing depending on the target IP, otherwise - AFAIK - the OS does not distinct between the incoming IP, it can route internally only to the port of the listening server, or not?