Comments (3)
The solution C-Dogs SDL uses is described here https://cxong.github.io/2016/01/how-to-write-a-lan-server where the listen port 34219 is only used for server discovery, and the game connection itself is on a random free port. This is to avoid having that port conflict with some other program, and also allow multiple servers on the same machine
I don't know what's the canonical way of solving this, would you need to just add a firewall exception for cdogs-sdl?
from cdogs-sdl.
Choosing random ports works fine on a LAN, where there are no firewall or other restrictions.
But for accepting connections from WAN/internet, the router (and a maybe firewall on the router) need to be configured to forward the ports to a machine inside the local network. Each time a different random port is chosen, the port needs to be figured out and the router needs to be re-configured with it.
A simple solution could be to pick random ports from a small but known range (e.g. 34220-34300). Such a fixed range can be easily configured in most routers.
Or maybe allow for configuration of the randomly chosen ports. Then the user can decide for themselves what ports to use.
would you need to just add a firewall exception for cdogs-sdl
On the machine itself it would be easy to allow every port of a program like cdogs-sdl, but the router (which is a different device) does not know the ports that cdogs-sdl is using, so it can't automatically forward them.
(There is UPnP for automated asking a router to forward ports to a machine, but using it is discouraged as it has a bunch of security problems.)
from cdogs-sdl.
I think it would be best to add a cmd line arg to specify the port to serve; since there is no standard way to specify a range for selecting a random port, we'd have to repeatedly bind() which could be very slow.
from cdogs-sdl.
Related Issues (20)
- Arch Linux x86_64: Segfault on startup HOT 7
- Zig development HOT 2
- Assets revamp
- Compass arrow points just below objective HOT 1
- Fix ubuntu/clang release build
- Build error with tinydir inlining HOT 7
- Crash with invalid config HOT 1
- Problem running itch.io version on Ubuntu 22.04 HOT 1
- 2.0 64-bit builds are missing .dll's HOT 1
- List of linux package managers where C-Dogs SDL is available HOT 1
- Re-evaluate OARS categorization HOT 1
- Use single channel for actor voices
- Add mission briefing menu in pause menu
- Segfault on startup in PlayMusic HOT 9
- Disable deploy on create or publish tag trigger
- Player 1 controls can affect other players in character selection HOT 1
- Linux build instructions don't work on Ubuntu versions older than 23.10
- Continue showing equip menu when players are done
- Resizing window breaks background image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdogs-sdl.