コード例 #1
0
        public HttpResponse ProcessHttpRequest(HttpRequest request)
        {
            //todo: can URI start with protocol?
            string contentLocation = request.Uri.TrimStart('/');
            IContentProvider contentProvider = contentPackage.GetContentProvider(contentLocation);

            if (contentProvider == null)
            {
                return HttpResponse.NotFound();
            }

            return contentProvider.GetContent();
        }
コード例 #2
0
 public IWebSocketHandler CreateWebSocketHandler(HttpRequest request, IWebSocket webSocket)
 {
     ISocketProvider socketProvider = GetSocketProvider(request.Uri);
     ISocket socket = socketProvider.CreateSocket(webSocket);
     return new WebSocketHandler(socketProvider, socket);
 }
コード例 #3
0
 public bool CanCreateWebSocketHandler(HttpRequest request)
 {
     ISocketProvider socketProvider = GetSocketProvider(request.Uri);
     return socketProvider != null;
 }