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(); }
public IWebSocketHandler CreateWebSocketHandler(HttpRequest request, IWebSocket webSocket) { ISocketProvider socketProvider = GetSocketProvider(request.Uri); ISocket socket = socketProvider.CreateSocket(webSocket); return new WebSocketHandler(socketProvider, socket); }
public bool CanCreateWebSocketHandler(HttpRequest request) { ISocketProvider socketProvider = GetSocketProvider(request.Uri); return socketProvider != null; }