mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-24 10:16:31 +00:00
consolidate web socket onto one port
This commit is contained in:
parent
ea559a6e27
commit
bc657237aa
20 changed files with 1900 additions and 478 deletions
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using WebSocketSharp.Net;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static string GetOperationName(this HttpListenerRequest request)
|
||||
{
|
||||
return request.Url.Segments[request.Url.Segments.Length - 1];
|
||||
}
|
||||
|
||||
public static void CloseOutputStream(this HttpListenerResponse response, ILogger logger)
|
||||
{
|
||||
try
|
||||
{
|
||||
response.OutputStream.Flush();
|
||||
response.OutputStream.Close();
|
||||
response.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.ErrorException("Error in HttpListenerResponseWrapper: " + ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue