Exemplo n.º 1
0
		/// <summary>
		/// Initializes a new instance of <see cref="SupperHttpService"/> class.
		/// </summary>
		public SupperHttpService(EventHandler<DiagnosticsEventArgs> eventHandler, HttpServerSettings settings)
			: base(eventHandler, settings)
		{
			files = new Dictionary<String, Byte[]>
			{
				{
					"favicon.ico", Encoding.UTF8.GetBytes(@"ProcessFileRequest")
				},
				{
					"movie.swf", Encoding.UTF8.GetBytes(@"ProcessFileRequest")
				}
			};

			campaigns = new Dictionary<String, Object>
			{
				{
					"AAAAQAAQABAAAAAAAAAAAA", new Object()
				}
			};
			/*
			RegisterRoute(GetFile.Route, (server, httpContext) => new GetFile(server, httpContext));

			RegisterRoute(GetRedirectRequest.Route, (server, httpContext) => new GetRedirectRequest(server, httpContext));

			RegisterRoute(PostSnifferResponseHandler.Route, (server, httpContext) => new PostSnifferResponseHandler(server, httpContext));
			*/
			State = EntityState.Inactive;
		}
Exemplo n.º 2
0
		static HttpServerBaseTests()
		{
			// 0.0 Get configuration as string
			var settingsAsString = File.ReadAllText(@"HttpServerSettings.json");

			// 0.1 Get service pointer manager configuration
			settings = JsonConvert.DeserializeObject<HttpServerSettings>(settingsAsString);

			// 0.6 Add prefix to configuration
			settings.Listener.Prefixes.Add(mainPrefix);

			// Install counters
			settings.PerformanceCounters.Values.Install();
		}