Exemplo n.º 1
0
        public Server(Reactor.Http.Server server, string path)
        {
            this.path   = path;

            this.server = server;

            if(this.server.OnContext == null)
            {
                this.server.OnContext = context =>
                {
                    context.Response.StatusCode = 401;

                    context.Response.ContentType = "text/plain";

                    context.Response.Write("method not allowed");

                    context.Response.End();
                };
            }

            this.servercb = this.server.OnContext;

            this.server.OnContext = this.OnContext;

            this.OnUpgrade = (context, callback) => callback(true, string.Empty);
        }
Exemplo n.º 2
0
        public Server(Reactor.Http.Server server, string path)
        {
            this.path = path;

            this.server = server;

            if (this.server.OnContext == null)
            {
                this.server.OnContext = context =>
                {
                    context.Response.StatusCode = 401;

                    context.Response.ContentType = "text/plain";

                    context.Response.Write("method not allowed");

                    context.Response.End();
                };
            }

            this.servercb = this.server.OnContext;

            this.server.OnContext = this.OnContext;

            this.OnUpgrade = (context, callback) => callback(true, string.Empty);
        }
Exemplo n.º 3
0
        public static Server Create(Reactor.Http.Server server, string path, Action <Socket> OnSocket)
        {
            var wsserver = new Server(server, path);

            wsserver.OnSocket = OnSocket;

            return(wsserver);
        }
Exemplo n.º 4
0
        public Server(int port, string path)
        {
            this.path = path;

            this.server = Reactor.Http.Server.Create(context => {
                context.Response.StatusCode = 401;

                context.Response.ContentType = "text/plain";

                context.Response.Write("method not allowed");

                context.Response.End();
            }).Listen(port);

            this.servercb = this.server.OnContext;

            this.server.OnContext = this.OnContext;

            this.OnUpgrade = (context, callback) => callback(true, string.Empty);
        }
Exemplo n.º 5
0
        public Server(int port, string path)
        {
            this.path = path;

            this.server = Reactor.Http.Server.Create(context => {

                context.Response.StatusCode = 401;

                context.Response.ContentType = "text/plain";

                context.Response.Write("method not allowed");

                context.Response.End();

            }).Listen(port);

            this.servercb = this.server.OnContext;

            this.server.OnContext = this.OnContext;

            this.OnUpgrade = (context, callback) => callback(true, string.Empty);
        }
Exemplo n.º 6
0
 public static Server Create(Reactor.Http.Server server, string path)
 {
     return(new Server(server, path));
 }
Exemplo n.º 7
0
 public static Server Create(Reactor.Http.Server server)
 {
     return(new Server(server, "/"));
 }