Пример #1
0
 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)));
 }
Пример #2
0
 public Request(RequestLine requestLine, HttpHeaders headers, byte[] body = null)
 {
     RequestLine = requestLine;
     Headers     = headers;
     if (body != null)
     {
         Body = body;
     }
 }
Пример #3
0
 public async Task WriteRequestLineAsync(RequestLine requestLine)
 {
     await WriteLineAsync(requestLine.ToString()).WithoutCapturingContext();
 }
Пример #4
0
        public async Task <RequestLine> ReadRequestLineAsync()
        {
            var line = await ReadLineAsync().WithoutCapturingContext();

            return(line == null ? null : RequestLine.Parse(line));
        }