Files
RobustToolbox/Robust.Server/ServerStatus/IStatusHandlerContext.cs
Pieter-Jan Briers dc1464b462 High-bandwidth transfer system (#6373)
* WebSocket-based data transfer system

* Move resource downloads/uploads to the new transfer system

Should drastically increase the permitted practical size

* Transfer impl for Lidgren

* Async impl for receive stream

* Use unbounded channel for Lidgren

* Add metrics

* More comments

* Add serverside stream limit to avoid being a DoS vector

* Fix tests

* Oops forgot to actually implement sequence channels in NetMessage

* Doc comment for NetMessage.SequenceChannel

* Release notes
2026-01-19 20:44:44 +01:00

64 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.WebSockets;
using System.Threading.Tasks;
using Microsoft.Extensions.Primitives;
namespace Robust.Server.ServerStatus
{
[NotContentImplementable]
public interface IStatusHandlerContext
{
HttpMethod RequestMethod { get; }
IPEndPoint RemoteEndPoint { get; }
/// <summary>
/// Stream that reads the request body data,
/// </summary>
Stream RequestBody { get; }
Uri Url { get; }
bool IsGetLike { get; }
IReadOnlyDictionary<string, StringValues> RequestHeaders { get; }
IDictionary<string, string> ResponseHeaders { get; }
bool KeepAlive { get; set; }
bool IsWebSocketRequest { get; }
Task<T?> RequestBodyJsonAsync<T>();
Task RespondNoContentAsync();
Task RespondAsync(
string text,
HttpStatusCode code = HttpStatusCode.OK,
string contentType = "text/plain");
Task RespondAsync(
string text,
int code = 200,
string contentType = "text/plain");
Task RespondAsync(
byte[] data,
HttpStatusCode code = HttpStatusCode.OK,
string contentType = "text/plain");
Task RespondAsync(
byte[] data,
int code = 200,
string contentType = "text/plain");
Task RespondErrorAsync(HttpStatusCode code);
Task RespondJsonAsync(object jsonData, HttpStatusCode code = HttpStatusCode.OK);
Task<Stream> RespondStreamAsync(HttpStatusCode code = HttpStatusCode.OK);
Task<WebSocket> AcceptWebSocketAsync();
}
}