jammsen / docker-sons-of-the-forest-dedicated-server

Docker container to easily provision and manage Sons of the Forest Dedicated Server with Wine
https://hub.docker.com/r/jammsen/sons-of-the-forest-dedicated-server
136 stars 20 forks source link

What IP:PORT to use after running the container and the possibility of reverse proxy using subdomain #41

Closed amin-nematix closed 7 months ago

amin-nematix commented 7 months ago

Have you read the Important information text above

Current behavior

This is not a problem, just a thoughts, after running everything how do I connect to the server, I meant there's 3 port mapping in the docker compose file, which port to use?

Also is it possible to implement reverse proxy using subdomain because I would like to connect using subdomain instead. I know how to setup reverse proxy to points to the container and I'm using Caddy.

I'm also planning to upgrade my VPS to 8vCPU and 8GB RAM

Desired behavior

No desired behaviour

Links to screenshots

No response

To Reproduce

Steps to reproduce the behavior: Running everything succesfully

Software setup

Hardware setup

Additional context

No response

jammsen commented 7 months ago

This is not a problem, just a thoughts, after running everything how do I connect to the server, I meant there's 3 port mapping in the docker compose file, which port to use?

Afaik, theese are the ports you can try out: GamePort (UDP): 8766 QueryPort (UDP): 27016 google keyword: sons of the forest port forwarding

Also is it possible to implement reverse proxy using subdomain because I would like to connect using subdomain instead. I know how to setup reverse proxy to points to the container and I'm using Caddy.

Im only connecting using my domain, always. Not sure what you mean by reverse proxy using subdomain, im using a sw-firewall with port-forwarding and on that WAN IP there is a domain attached via DNS, it just works that way. But networking isnt part of the image and wont be, thats up to you and your decisions and your solutions out of maybe millions of combinations. Dunno what you mean by Caddy.

I'm also planning to upgrade my VPS to 8vCPU and 8GB RAM

This is only limited helpful to know, what you want to upgrade to, doesnt help to figure out if you even reach the MSR here and now though.

amin-nematix commented 7 months ago

This is not a problem, just a thoughts, after running everything how do I connect to the server, I meant there's 3 port mapping in the docker compose file, which port to use?

Afaik, theese are the ports you can try out: GamePort (UDP): 8766 QueryPort (UDP): 27016 google keyword: sons of the forest port forwarding

Also is it possible to implement reverse proxy using subdomain because I would like to connect using subdomain instead. I know how to setup reverse proxy to points to the container and I'm using Caddy.

Im only connecting using my domain, always. Not sure what you mean by reverse proxy using subdomain, im using a sw-firewall with port-forwarding and on that WAN IP there is a domain attached via DNS, it just works that way. But networking isnt part of the image and wont be, thats up to you and your decisions and your solutions out of maybe millions of combinations. Dunno what you mean by Caddy.

I'm also planning to upgrade my VPS to 8vCPU and 8GB RAM

This is only limited helpful to know, what you want to upgrade to, doesnt help to figure out if you even reach the MSR here and now though.

Hi jammsen,

I have successfully be able to join my server using public ip and port. Now I'm using my subdomain sotf.famintech.com thru reverse proxy that redirects to http://localhost:8766. I try to connect using that subdomain, it didn't work. I tried pinging the subdomain and I got back my server ip so it shouldn't be problem with DNS. You said you always joined using subdomain isn't?

WhatsApp Image 2024-02-29 at 10 55 20 AM

WhatsApp Image 2024-02-29 at 10 55 25 AM

gitzec commented 7 months ago

A reverse proxy usually speaks http and cannot be used for sotf. You need port forwarding to pass any nat. But just defining an name by a record should not need any forwarding or proxy ing. Turn all off and use dns only.

amin-nematix commented 7 months ago

A reverse proxy usually speaks http and cannot be used for sotf. You need port forwarding to pass any nat. But just defining an name by a record should not need any forwarding or proxy ing. Turn all off and use dns only.

I don't quite understand what you're saying. Means I can't use subdomain and strictly just use IP and Port? and I'm running the docker container on a hosted VPS, why is the need for port forwarding?

gitzec commented 7 months ago

sure you can. i will explain a bit...

a DNS = domain name system/service = some service which can do sub-(domain) mapping. example: some.server.com has an A record (ipv4) and returns an ip v4 address like 111.111.111.111 when being asked about it. it also can have an AAAA record (ipv6), an spf record (for secure emailing, at least one of the tries to make old email more secure..., forget it). it can have txt records for any kind of domain validation... and many other types like cname or whatever...

i guess you just need the A record type to tell your game clients which want to know where your subdomain is at (ipv4).

process: the client wants to connect to your server. it asks it's dns server for the ip address of sotf.famintech.com and the dns responds with that. then the client will connect to the ip address to use the service like sotf server which has an own protocol for exchanging info/data like where are the other players, where are the trees, ... if your server is in an ipv4 network behind a router eg. in your home network, you must make it accessible via port forwarding. if it is in an ipv6 network, you must tell the router to allow direct connections to the container's published ports.

a REVERSE PROXY service has it's own ip and sits in front of a (usually web-)service. it accepts connections from clients (usually web browsers) and then pulls the info/data from the origin server behind the proxy. the client does not have a direct connection to the origin and does not even know where the service behind the proxy is located at. a reverse proxy can do some caching, security stuff and/or load balancing. but this is http/web technology and has nothing to do with this docker image for a sotf server service.

there are reverse proxies which can do other protocols or even simple ip based load balancing. but i doubt that this is what you are about.

if you still have any questions regarding reverse proxy in your case i must know of which reverse proxy product you are talking about.

edit: after looking at your screenshots: maybe sotf cannot even do dns and wants an ip and a port.

why not just select the server from the ingame server list?

amin-nematix commented 7 months ago

sure you can. i will explain a bit...

a DNS = domain name system/service = some service which can do sub-(domain) mapping. example: some.server.com has an A record (ipv4) and returns an ip v4 address like 111.111.111.111 when being asked about it. it also can have an AAAA record (ipv6), an spf record (for secure emailing, at least one of the tries to make old email more secure..., forget it). it can have txt records for any kind of domain validation... and many other types like cname or whatever...

i guess you just need the A record type to tell your game clients which want to know where your subdomain is at (ipv4).

process: the client wants to connect to your server. it asks it's dns server for the ip address of sotf.famintech.com and the dns responds with that. then the client will connect to the ip address to use the service like sotf server which has an own protocol for exchanging info/data like where are the other players, where are the trees, ... if your server is in an ipv4 network behind a router eg. in your home network, you must make it accessible via port forwarding. if it is in an ipv6 network, you must tell the router to allow direct connections to the container's published ports.

a REVERSE PROXY service has it's own ip and sits in front of a (usually web-)service. it accepts connections from clients (usually web browsers) and then pulls the info/data from the origin server behind the proxy. the client does not have a direct connection to the origin and does not even know where the service behind the proxy is located at. a reverse proxy can do some caching, security stuff and/or load balancing. but this is http/web technology and has nothing to do with this docker image for a sotf server service.

there are reverse proxies which can do other protocols or even simple ip based load balancing. but i doubt that this is what you are about.

if you still have any questions regarding reverse proxy in your case i must know of which reverse proxy product you are talking about.

edit: after looking at your screenshots: maybe sotf cannot even do dns and wants an ip and a port.

why not just select the server from the ingame server list?

Thanks for the feedback, I think this has to do with SOTF itself or might I say, Steam which doesnt allow dedicated server via domain. Maybe there's a way around it but after doing a lot of research and googling, this might be a feature/bug that had been requested for many years but Steam ain't doing anything about it. Anyways, thank you 👍