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); }
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); }
public static Server Create(Reactor.Http.Server server, string path, Action <Socket> OnSocket) { var wsserver = new Server(server, path); wsserver.OnSocket = OnSocket; return(wsserver); }
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); }
public static Server Create(Reactor.Http.Server server, string path) { return(new Server(server, path)); }
public static Server Create(Reactor.Http.Server server) { return(new Server(server, "/")); }