Revert public host config

This commit is contained in:
2023-07-31 14:49:04 +01:00
parent 112ed5b80a
commit 055e7b0487
5 changed files with 14 additions and 3 deletions

View File

@ -58,4 +58,5 @@ public sealed class S3BlobConfig
public string? Region { get; init; }
public string BucketName { get; init; } = "zap-stream-dvr";
public bool DisablePayloadSigning { get; init; }
public Uri PublicHost { get; init; } = null!;
}

View File

@ -39,7 +39,8 @@ public class SrsController : Controller
Variant = appSplit.Length > 1 ? appSplit[1] : "",
ClientId = req.ClientId!,
StreamId = req.StreamId ?? req.ClientId!,
StreamKey = req.Stream
StreamKey = req.Stream,
EdgeIp = req.Ip!
});
if (req.Action == "on_forward")

View File

@ -74,11 +74,17 @@ public class S3DvrStore : IDvrStore
Expires = new DateTime(3000, 1, 1)
});
var ub = new UriBuilder(url)
{
Scheme = _config.PublicHost.Scheme,
Host = _config.PublicHost.Host
};
var tsUpload = sw.Elapsed;
_logger.LogInformation("download={tc:#,##0}ms, probe={pc:#,##0}ms, upload={uc:#,##0}ms", tsDownload.TotalMilliseconds,
tsProbe.TotalMilliseconds, tsUpload.TotalMilliseconds);
return new(new Uri(url), probe.Duration.TotalSeconds);
return new(ub.Uri, probe.Duration.TotalSeconds);
}
}

View File

@ -11,4 +11,6 @@ public class StreamInfo
public string ClientId { get; init; } = null!;
public string StreamId { get; init; } = null!;
public string EdgeIp { get; init; } = null!;
}

View File

@ -28,7 +28,8 @@
"DvrStore": {
"ServiceUrl": "http://localhost:9010",
"AccessKey": "TQcxug1ZAXfnZ5bvc9n5",
"SecretKey": "p7EK4qew6DBkBPqrpRPuJgTOc6ChUlfIcEdAwE7K"
"SecretKey": "p7EK4qew6DBkBPqrpRPuJgTOc6ChUlfIcEdAwE7K",
"PublicHost": "http://localhost:9010"
}
}
}