static void Main(string[] args) { using ItzContext db = new ItzContext(); db.Database.EnsureCreated(); AuthHandler handler = new AuthHandler(db); var server = new WebSocketServer("ws://0.0.0.0:811"); server.AddWebSocketService("/chat", () => new ChatServer(handler, db)); server.Start(); Console.ReadKey(); server.Stop(); }
public ChatServer(AuthHandler auth, ItzContext db) : base() { this.auth = auth; this.db = db; }