refactor: open takes server not ctor
This commit is contained in:
parent
1fe654af60
commit
652e96db4b
|
@ -10,9 +10,8 @@ const decorateServer = compose(
|
|||
|
||||
export class Server extends decorateServer(class {}) {
|
||||
|
||||
constructor(httpServer) {
|
||||
constructor() {
|
||||
super();
|
||||
this.httpServer = httpServer;
|
||||
this.onConnect = this.onConnect.bind(this);
|
||||
}
|
||||
|
||||
|
@ -25,8 +24,8 @@ export class Server extends decorateServer(class {}) {
|
|||
this.emit('connect', new ServerSocket(socket));
|
||||
}
|
||||
|
||||
open() {
|
||||
this.io = new SocketServer(this.httpServer, {
|
||||
open(httpServer) {
|
||||
this.io = new SocketServer(httpServer, {
|
||||
parser: SocketIoParser,
|
||||
path: '/avocado',
|
||||
perMessageDeflate: false,
|
||||
|
|
Loading…
Reference in New Issue
Block a user