<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fedgegap</id>
	<title>Unity.Multiplayer/articles/hosting/edgegap - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fedgegap"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/edgegap&amp;action=history"/>
	<updated>2026-12-05T10:28:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/edgegap&amp;diff=916&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/edgegap&amp;diff=916&amp;oldid=prev"/>
		<updated>2026-11-29T20:36:48Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Hosting on Edgegap (Edgegap) =&lt;br /&gt;
&lt;br /&gt;
The per-match allocation profile (UM-T29): instead of one server that stays up (GenericVps, RunPod and the rest of the hosting table), Edgegap deploys one container &amp;lt;strong&amp;gt;per match&amp;lt;/strong&amp;gt;, on demand, close to the players in it, and you tear it down when the match ends. This is the right shape for a game that runs short matches rather than a persistent world.&lt;br /&gt;
&lt;br /&gt;
Unlike every other profile in this table, Edgegap is not driven by &amp;lt;code&amp;gt;mp-host deploy&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;logs&amp;lt;/code&amp;gt;/ &amp;lt;code&amp;gt;update&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt; -- there is no single long-running server for those commands to act on. Instead, Core&amp;#039;s &amp;lt;code&amp;gt;Unity.Multiplayer.Core.EdgegapMatchAllocator&amp;lt;/code&amp;gt; implements the UM-T29 &amp;lt;code&amp;gt;IMatchAllocator&amp;lt;/code&amp;gt; contract: a matchmaker (your own backend, or a quick test harness) calls &amp;lt;code&amp;gt;AllocateAsync&amp;lt;/code&amp;gt; when a match is ready and &amp;lt;code&amp;gt;ReleaseAsync&amp;lt;/code&amp;gt; once it ends.&lt;br /&gt;
&lt;br /&gt;
== How it fits together ==&lt;br /&gt;
&lt;br /&gt;
# mp-host still builds the server package and pushes its image to GHCR, exactly as for every other profile (&amp;lt;code&amp;gt;ServerPackageBuilder&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;DockerCliImageTool&amp;lt;/code&amp;gt;, UM-T23/UM-T25).&lt;br /&gt;
# Once per build, call &amp;lt;code&amp;gt;EdgegapMatchAllocator.EnsureAppVersionAsync(imageReference, ports)&amp;lt;/code&amp;gt;. This creates or updates the Edgegap app version that points at the pushed GHCR image and declares the ports the container exposes (the game port, named &amp;lt;code&amp;gt;&amp;quot;game&amp;quot;&amp;lt;/code&amp;gt; by default).&lt;br /&gt;
# Per match, your matchmaker calls &amp;lt;code&amp;gt;EdgegapMatchAllocator.AllocateAsync(new MatchRequest(matchId, maxPlayers, region))&amp;lt;/code&amp;gt;. The allocator asks Edgegap to deploy that app version, polls until Edgegap reports the container running with its ports mapped, and returns a &amp;lt;code&amp;gt;MatchAllocation&amp;lt;/code&amp;gt;: the endpoint (&amp;lt;code&amp;gt;JoinTarget&amp;lt;/code&amp;gt;, a public IP and the external port Edgegap mapped to your game port) and a join code published through whatever &amp;lt;code&amp;gt;IJoinCodeService&amp;lt;/code&amp;gt; you give the allocator (the self-hosted rendezvous service from UM-T12 works well here, since its codes are reachable by any client that knows the service&amp;#039;s URL -- not just this process).&lt;br /&gt;
# Hand the player the join code (or the endpoint directly); &amp;lt;code&amp;gt;NetSession.JoinAllocatedServerAsync&amp;lt;/code&amp;gt; on the client side requests nothing itself -- it just joins what the allocation already resolved.&lt;br /&gt;
# Once the match is over, call &amp;lt;code&amp;gt;EdgegapMatchAllocator.ReleaseAsync(allocation)&amp;lt;/code&amp;gt;: it revokes the join code and stops the Edgegap deployment.&lt;br /&gt;
&lt;br /&gt;
== Setting it up ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;var api = new HttpEdgegapApiClient(apiToken); // from the Edgegap dashboard&amp;#039;s API token page&lt;br /&gt;
var rendezvous = new RendezvousJoinCodeService(new RendezvousClient(rendezvousUrl), rendezvousSecret, serverAdvertisement: null);&lt;br /&gt;
var allocator = new EdgegapMatchAllocator(api, rendezvous, appName: &amp;quot;my-game&amp;quot;, versionName: &amp;quot;v1.2.0&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
await allocator.EnsureAppVersionAsync(&lt;br /&gt;
    &amp;quot;ghcr.io/myorg/mygame:v1.2.0&amp;quot;,&lt;br /&gt;
    new[] { new EdgegapPortSpec(&amp;quot;game&amp;quot;, 7777, TransportKind.Udp) },&lt;br /&gt;
    environmentVariables: new Dictionary&amp;amp;lt;string, string&amp;gt; { [&amp;quot;MINDATTIC_RENDEZVOUS_URL&amp;quot;] = rendezvousUrl });&lt;br /&gt;
&lt;br /&gt;
MatchAllocation allocation = await allocator.AllocateAsync(new MatchRequest(&amp;quot;match-42&amp;quot;, maxPlayers: 8, region: &amp;quot;eu-west&amp;quot;));&lt;br /&gt;
// hand allocation.Code (or allocation.Endpoint) to players ...&lt;br /&gt;
// ... match plays out ...&lt;br /&gt;
await allocator.ReleaseAsync(allocation);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store the API token in the vault, never the repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host credentials set-edgegap --token &amp;amp;lt;Edgegap API token&amp;gt; --app-name my-game&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;code&amp;gt;mp-host&amp;lt;/code&amp;gt; itself does not call Edgegap&amp;#039;s API -- &amp;lt;code&amp;gt;set-edgegap&amp;lt;/code&amp;gt; only gives your matchmaking service, or a one-off script, a place to read the token from instead of hard-coding it.)&lt;br /&gt;
&lt;br /&gt;
== Cost and sizing notes ==&lt;br /&gt;
&lt;br /&gt;
Edgegap bills for the time a deployment runs, by its resource tier (CPU/RAM) -- there is no &amp;quot;always on&amp;quot; cost the way a VPS has, since a deployment only exists for the length of a match. &amp;lt;code&amp;gt;EdgegapMatchAllocator.ReleaseAsync&amp;lt;/code&amp;gt; stops billing for that match the moment it is called, so a matchmaker that forgets to call it on every exit path (a crash, a dropped last player) is the one way to leak cost here; wrap match lifecycles in a &amp;lt;code&amp;gt;finally&amp;lt;/code&amp;gt; that always releases. Verify Edgegap&amp;#039;s current regions, resource tiers and app-version/deployment API shape against their live docs before depending on this for a public launch -- this is also why the real-provider smoke test (&amp;lt;code&amp;gt;tests/Core.Tests/EdgegapSmokeTests.cs&amp;lt;/code&amp;gt;) is opt-in rather than part of every build: it costs real money and depends on Edgegap&amp;#039;s schema not having drifted since this was written.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/hosting/edgegap.md Unity.Multiplayer/docs/articles/hosting/edgegap.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>