protected override bool VerifyWebSocketHandshake() { return("websocket".Equals(Headers.Upgrade, StringComparison.OrdinalIgnoreCase) && RequestLine != null && RequestLine.IsVerb("GET") && ("ws".Equals(Uri.Scheme, StringComparison.OrdinalIgnoreCase) || "wss".Equals(Uri.Scheme, StringComparison.OrdinalIgnoreCase))); }
public Request(RequestLine requestLine, HttpHeaders headers, byte[] body = null) { RequestLine = requestLine; Headers = headers; if (body != null) { Body = body; } }
public async Task WriteRequestLineAsync(RequestLine requestLine) { await WriteLineAsync(requestLine.ToString()).WithoutCapturingContext(); }
public async Task <RequestLine> ReadRequestLineAsync() { var line = await ReadLineAsync().WithoutCapturingContext(); return(line == null ? null : RequestLine.Parse(line)); }