LogoLogo
edgegap.comDashboard
  • 📘Learning Center
    • Getting Started
    • Unity Games
      • Getting Started - Servers
      • Developer Tools
    • Unreal Engine Games
      • Getting Started - Servers
      • Developer Tools
    • Matchmaking
      • Getting Started
      • Matchmaker In-Depth
      • Ping Beacons
    • Advanced Features
      • Apps and Versions
      • Deployments
      • Managed Clusters
  • API Reference
    • Dedicated Servers
    • Integration
    • Matchmaking
    • Peer to Peer
  • Release Notes
  • 📚Documentation
    • Sample Projects
      • Unity Netcodes
        • Unity NGO
        • Photon Fusion 1
        • Photon Fusion 2
        • Mirror
        • Mirror WebGL
        • Fishnet
        • Fishnet WebGL
        • Photon Bolt
      • Unreal Top-Down Sample
      • NuxtJS
      • Ruby On Rails
      • Unity Lobbies
      • Unity Matchmaker
    • Tools & Integrations
      • Container
        • What is Docker
        • Your First Docker
        • The Good Practices
        • SSH in Your Container
        • External Registries
          • Docker Hub
          • AWS ECR
          • GCP GCR
          • Gitlab registry
      • Deploy from Nakama
      • EOS Lobby Integration
      • Switch From Gamelift
      • Switch From Multiplay
      • Playfab Bridge
    • Deployment
      • Endpoint Storage
        • How to Save Logs
        • Upload File to Deployment
      • Webhooks
    • Application
      • Command and Arguments
      • 1:1 Port Mapping
    • Session
      • How They Work
      • Application Version Configuration
      • Manage Request
      • Selectors Filtering
    • Fleet
      • Fleet Policy
      • Policy Filter
      • Linking Version
      • Fleet's Deployment
    • Container Registry
    • Distributed Relay
      • Matchmaker/Lobby
      • Relay Edgegap API
      • Transport Samples
    • Lobby
      • Lobby Service
      • Functions
    • Glossary
    • SLA Terms
Powered by GitBook
LogoLogo

Connect with Community

  • Discord
  • Linkedin
  • X

Read More

  • Release Notes
  • Blog
  • Enterprise
  • Legal
  • edgegap.com

© 2025 Edgegap

On this page
  • Create a 1:1 port
  • Verification

Was this helpful?

  1. Documentation
  2. Application

1:1 Port Mapping

PreviousCommand and ArgumentsNextSession

Last updated 2 months ago

Was this helpful?

This option is helpful for legacy game servers or games that doesn't support NAT punching, which means that your game probably needs the same port for the external and internal ones.

By using 1:1 port mapping, every time you deploy your application, your container will be assigned a random port. This port will be used for the internal and external ports. You will need to retrieve this port to specify to your server that it's listening and serving on it.

Create a 1:1 port

With the Dashboard

When creating ports in the application version form, there will be an option to activate 1:1 port mapping. It will automatically input 0 as a port, and you will not be able to modify it. You must use the checkbox. You cannot manually input 0.

When using 1:1 port mapping, the port name becomes mandatory. The name will be used to easily retrieve your port later in the deployment details.

1:1 ports can be duplicated since a unique random port will be assigned.

With the API

To create a 1:1 port with the API, you only need to put 0 as the port value.

When using 1:1 port mapping, the port name becomes mandatory. The name will be used to easily retrieve your port later in the deployment details.

1:1 ports can be duplicated since a unique random port will be assigned.

{
  "name": "v1",
  "docker_repository": "docker.io",
  "docker_image": "edgegap/tutorial",
  "docker_tag": "0.2.37",
  "req_cpu": 128,
  "req_memory": 256,
  "ports": [
    {
      "port": 0,
      "protocol": "TCP",
      "to_check": true,
      "name": "game_port"
    }
  ]
}

Retrieving your ports

Since this option will assign a unique random port, you will need a way to get the given port.

Your deployment will have injected environment variables ARBITRIUM_PORTS_MAPPING and ARBITRIUM_PUBLIC_IP. Port mapping is a JSON string with this format:

{
  "ports": {
    "game_port": {
      "name": "game_port",
      "internal": 31000,
      "external": 31000,
      "protocol": "TCP"
    },
    "5000": {
      "name": null,
      "internal": 5000,
      "external": 31500,
      "protocol": "HTTP"
    }
  }
}

You can also make an API call inside your container using the ARBITRIUM_CONTEXT_URL. It will give you all the details for your deployment. You will also need to activate the inject context option in your application version.

You can use a mix of 1:1 and standard non-dynamic ports.

Verification

If you are using the port verification option, you should ensure that your server tries to assign its internal port as soon as possible. If your server is doing a long operation before getting its ports up, the verification may fail due to a port not responding.

If doing a long operation is inevitable, please contact us so we can increase the maximum time to do the port verification for your application.

📚