Add SRV Record support

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Chrischhan
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Nov 13, 2019 2:37 pm
Contact:

Re: Add SRV Record support

Post by Chrischhan »

Are there any news on this Topic? Any Dev on this?

movax20h
Fast Inserter
Fast Inserter
Posts: 163
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: Add SRV Record support

Post 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.

Railgunning
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Jan 30, 2020 5:31 pm
Contact:

Re: Add SRV Record support

Post by Railgunning »

+1, I host for a let's say...easily confused...group of friends. This would streamline things :)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post 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/
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

chris13524
Fast Inserter
Fast Inserter
Posts: 207
Joined: Thu Jun 04, 2015 12:20 am
Contact:

Re: Add SRV Record support

Post 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.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post 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...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Gellis12
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon May 27, 2019 8:31 am
Contact:

Re: Add SRV Record support

Post 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.
Last edited by Gellis12 on Fri Jan 31, 2020 1:27 am, edited 1 time in total.

chris13524
Fast Inserter
Fast Inserter
Posts: 207
Joined: Thu Jun 04, 2015 12:20 am
Contact:

Re: Add SRV Record support

Post 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?

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post by ssilk »

Sorry, this evening iPad only. :? :roll:
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

chris13524
Fast Inserter
Fast Inserter
Posts: 207
Joined: Thu Jun 04, 2015 12:20 am
Contact:

Re: Add SRV Record support

Post 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

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post 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.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

chris13524
Fast Inserter
Fast Inserter
Posts: 207
Joined: Thu Jun 04, 2015 12:20 am
Contact:

Re: Add SRV Record support

Post 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" :)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post 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.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
redlabel
Fast Inserter
Fast Inserter
Posts: 145
Joined: Mon Feb 06, 2017 8:50 pm
Contact:

Re: Add SRV Record support

Post 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.
✧COMFY FACTORIO✧ - Home of Biter Battles, Fish Defense, Chronotrain.. And More!

de_w
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Dec 19, 2014 2:19 pm
Contact:

Re: Add SRV Record support

Post by de_w »

+1 to srv records, if not to much of an effort with 1.0 coming up.

ModProg
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Dec 02, 2020 4:18 pm
Contact:

Re: Add SRV Record support

Post by ModProg »

+1 Would be really helpful for having Server Addresses People can remember ;)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post 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.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

robot256
Fast Inserter
Fast Inserter
Posts: 165
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Add SRV Record support

Post 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.

Gellis12
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon May 27, 2019 8:31 am
Contact:

Re: Add SRV Record support

Post 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.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12273
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add SRV Record support

Post 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?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Ideas and Suggestions”