示例#1
0
        public BufferSegment RspAcceptedFrame(AccessInfo access)
        {
            var accept = new AcceptInfo()
            {
                Connection           = access.Connection,
                Upgrade              = access.Upgrade,
                SecWebSocketLocation = access.Host,
                SecWebSocketOrigin   = access.Origin,
                SecWebSocketAccept   = (access.SecWebSocketKey + acceptMask).ToSha1Base64(encoding)
            };

            return(new BufferSegment(encoding.GetBytes(accept.ToString())));
        }
示例#2
0
        public BufferSegment RspAcceptedFrame(AccessInfo access)
        {
            var accept = new AcceptInfo()
            {
                connection           = access.connection,
                upgrade              = access.upgrade,
                secWebSocketLocation = access.host,
                secWebSocketOrigin   = access.origin,
                secWebSocketAccept   = (access.secWebSocketKey + _acceptMask).ToSha1Base64(_encoding)
            };

            return(new BufferSegment(_encoding.GetBytes(accept.ToString())));
        }