mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-06 10:16:18 +00:00
automate loopback exception for windows store app
This commit is contained in:
@@ -51,7 +51,6 @@ namespace MediaBrowser.Server.Implementations.Udp
|
||||
|
||||
AddMessageResponder("who is EmbyServer?", RespondToV2Message);
|
||||
AddMessageResponder("who is MediaBrowserServer_v2?", RespondToV2Message);
|
||||
AddMessageResponder("who is MediaBrowserServer?", RespondToV1Message);
|
||||
}
|
||||
|
||||
private void AddMessageResponder(string message, Action<string, Encoding> responder)
|
||||
@@ -94,31 +93,6 @@ namespace MediaBrowser.Server.Implementations.Udp
|
||||
}
|
||||
}
|
||||
|
||||
private async void RespondToV1Message(string endpoint, Encoding encoding)
|
||||
{
|
||||
var localUrl = await _appHost.GetLocalApiUrl().ConfigureAwait(false);
|
||||
|
||||
if (!string.IsNullOrEmpty(localUrl))
|
||||
{
|
||||
// This is how we did the old v1 search, so need to strip off the protocol
|
||||
var index = localUrl.IndexOf("://", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
localUrl = localUrl.Substring(index + 3);
|
||||
}
|
||||
|
||||
// Send a response back with our ip address and port
|
||||
var response = String.Format("MediaBrowserServer|{0}", localUrl);
|
||||
|
||||
await SendAsync(Encoding.UTF8.GetBytes(response), endpoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Warn("Unable to respond to udp request because the local ip address could not be determined.");
|
||||
}
|
||||
}
|
||||
|
||||
private async void RespondToV2Message(string endpoint, Encoding encoding)
|
||||
{
|
||||
var localUrl = await _appHost.GetLocalApiUrl().ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user