示例#1
0
 internal WebSocket(TcpListenerWebSocketContext context)
     : this()
 {
     _uri = Ext.ToUri(context.Path);
     _context = context;
     _tcpClient = context.Client;
     _wsStream = context.Stream;
     _endPoint = context.ServerEndPoint;
     _isClient = false;
     _isSecure = context.IsSecureConnection;
 }
 public static RequestHandshake Parse(WebSocketContext context)
 {
     return new RequestHandshake {
     Headers         = context.Headers,
     HttpMethod      = "GET",
     RequestUri      = context.RequestUri,
     ProtocolVersion = HttpVersion.Version11
       };
 }
 internal WebSocket(HttpListenerWebSocketContext context)
     : this()
 {
     _uri         = context.Path.ToUri();
       _context     = context;
       _httpContext = context.BaseContext;
       _wsStream    = context.Stream;
       _endPoint    = context.ServerEndPoint;
       _isClient    = false;
       _isSecure    = context.IsSecureConnection;
 }