public P2pProxyDevice(WebServer webServer, P2pProxyApp proxy) : base(webServer) { udn = Guid.NewGuid(); friendlyName = "P2pProxy DLNA (" + Environment.MachineName + ")"; deviceType = "urn:schemas-upnp-org:device:MediaServer:1"; manufacturer = "BeGoodSoft"; modelName = "P2pProxy DLNA Server"; modelNumber = P2pProxyApp.Version; serialNumber = udn.ToString(); modelUrl = "*****@*****.**"; Web.AddRouteUrl("/login", LoginRequest, HttpMethod.Get); Web.AddRouteUrl("/stat", StatRequest, HttpMethod.Get); Web.AddRouteUrl("/clear_broadcast", ClearBroadcast, HttpMethod.Get); if (P2pProxyApp.MySettings.GetSetting("dlna", "enable", true)) { Web.AddRouteUrl("/dlna/description.xml", SendDescription, HttpMethod.Get); Web.AddRouteUrl("/dlna/logo48.png", SendFile, HttpMethod.Get); services.Add(new ConnectionManagerService(server, this)); services.Add(new ContentDirectoryService(server, this)); services.Add(new MediaReceiverRegistrarService(server, this)); } Proxy = proxy; Filter = new ContentFilter("root"); }
public void AddRoute(string url, Action <MyWebRequest> route, HttpMethod method) { Web.AddRouteUrl(url, route, method); }