Exemplo n.º 1
0
        /// <summary>
        /// Uses HTTP Protocol and accepts HTTP connections
        /// </summary>
        public static IHorseServer UseHttp(this IHorseServer server, HttpRequestHandler action, string optionsFilename)
        {
            HttpMethodHandler handler  = new HttpMethodHandler(action);
            HorseHttpProtocol protocol = new HorseHttpProtocol(server, handler, HttpOptions.Load(optionsFilename));

            server.UseProtocol(protocol);
            return(server);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Uses HTTP Protocol and accepts HTTP connections
        /// </summary>
        public static IHorseServer UseHttp(this IHorseServer server, HttpRequestHandler action, HttpOptions options)
        {
            HttpMethodHandler handler  = new HttpMethodHandler(action);
            HorseHttpProtocol protocol = new HorseHttpProtocol(server, handler, options);

            server.UseProtocol(protocol);
            return(server);
        }