mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
* 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
64 lines
1.7 KiB
C#
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();
|
|
}
|
|
}
|