/// <summary>
 /// Initializes a new instance of the <see cref="ClientHandshake"/> class.
 /// </summary>
 /// <param name="challengeBytes">The challenge bytes.</param>
 /// <param name="header">The header.</param>
 public ClientHandshake(ArraySegment<byte> challengeBytes, Header header)
 {
     ChallengeBytes = challengeBytes;
     ResourcePath = header.RequestPath;
     Key1 = header["sec-websocket-key1"];
     Key2 = header["sec-websocket-key2"];
     SubProtocols = header.SubProtocols;
     Origin = header["origin"];
     Host = header["host"];
     Cookies = header.Cookies;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientHandshake"/> class.
 /// </summary>
 /// <param name="header">The header.</param>
 public ClientHandshake(Header header)
 {
     ResourcePath = header.RequestPath;
     Key = header["sec-websocket-key"];
     SubProtocol = header["sec-websocket-protocol"];
     Origin = header["origin"];
     if (String.IsNullOrEmpty(Origin))
     {
         Origin = header["sec-websocket-origin"];
     }
     Host = header["host"];
     Version = header["sec-websocket-version"];
     Cookies = header.Cookies;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerHandshake"/> class.
 /// </summary>
 /// <param name="header">The header.</param>
 public ServerHandshake(Header header)
 {
     Accept = header["Sec-WebSocket-Accept"];
     SubProtocol = header["Sec-WebSocket-Protocol"];
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerHandshake"/> class.
 /// </summary>
 /// <param name="header">The header.</param>
 public ServerHandshake(Header header)
 {
     Accept = header["Sec-WebSocket-Accept"];
 }