Skip to content

Commit

Permalink
Added dynamic configuration of http port.
Browse files Browse the repository at this point in the history
  • Loading branch information
roberthbailey committed Oct 18, 2019
1 parent 94191c6 commit a343963
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdks/unity/AgonesSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AgonesSdk : MonoBehaviour
/// </summary>
public bool logEnabled = false;

private const string sidecarAddress = "http://localhost:59358";
private string sidecarAddress;
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();

private struct KeyValueMessage
Expand All @@ -58,6 +58,8 @@ private struct KeyValueMessage
// Use this for initialization.
private void Start()
{
String port = Environment.GetEnvironmentVariable("AGONES_SDK_HTTP_PORT");
sidecarAddress = "http://localhost:" + (port ?? "59358");
HealthCheckAsync();
}

Expand Down

0 comments on commit a343963

Please sign in to comment.