mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Remove websocket options and configure kestrel listen ports
This commit is contained in:
parent
4e8de67aca
commit
e88f079da6
@ -111,13 +111,11 @@ using Microsoft.AspNetCore.Hosting;
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Extensions;
|
using Microsoft.AspNetCore.Http.Extensions;
|
||||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||||
using Microsoft.AspNetCore.Routing;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using ServiceStack;
|
using ServiceStack;
|
||||||
using HttpResponse = MediaBrowser.Model.Net.HttpResponse;
|
|
||||||
using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate;
|
using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations
|
namespace Emby.Server.Implementations
|
||||||
@ -623,21 +621,24 @@ namespace Emby.Server.Implementations
|
|||||||
FindParts();
|
FindParts();
|
||||||
|
|
||||||
Host = new WebHostBuilder()
|
Host = new WebHostBuilder()
|
||||||
.UseKestrel()
|
.UseKestrel(options =>
|
||||||
|
{
|
||||||
|
options.Listen(IPAddress.Any, HttpPort);
|
||||||
|
options.Listen(IPAddress.Loopback, HttpPort);
|
||||||
|
// TODO certs
|
||||||
|
options.Listen(IPAddress.Any, HttpsPort, listenOptions => { listenOptions.UseHttps(); });
|
||||||
|
options.Listen(IPAddress.Loopback, HttpsPort, listenOptions => { listenOptions.UseHttps(); });
|
||||||
|
})
|
||||||
.UseContentRoot(Path.Combine(Directory.GetCurrentDirectory(), "jellyfin-web", "src"))
|
.UseContentRoot(Path.Combine(Directory.GetCurrentDirectory(), "jellyfin-web", "src"))
|
||||||
.UseUrls("http://localhost:8096")
|
|
||||||
.ConfigureServices(services =>
|
.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
services.AddResponseCompression();
|
services.AddResponseCompression();
|
||||||
services.AddHttpContextAccessor();
|
services.AddHttpContextAccessor();
|
||||||
services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();
|
services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();
|
||||||
})
|
})
|
||||||
.Configure( app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseWebSockets(new WebSocketOptions {
|
app.UseWebSockets();
|
||||||
KeepAliveInterval = TimeSpan.FromMilliseconds(1000000000),
|
|
||||||
ReceiveBufferSize = 0x10000
|
|
||||||
});
|
|
||||||
|
|
||||||
app.UseResponseCompression();
|
app.UseResponseCompression();
|
||||||
app.Use(ExecuteWebsocketHandlerAsync);
|
app.Use(ExecuteWebsocketHandlerAsync);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user