sync/src/io/backend/iobackend.js

21 lines
623 B
JavaScript
Raw Normal View History

2015-12-24 16:24:07 -08:00
import Server from 'cytube-common/lib/tcpjson/server';
import FrontendManager from './frontendmanager';
export default class IOBackend {
constructor(proxyListenerConfig) {
this.proxyListenerConfig = proxyListenerConfig;
this.initFrontendManager();
this.initProxyListener();
}
initFrontendManager() {
this.frontendManager = new FrontendManager();
}
initProxyListener() {
this.proxyListener = new Server(this.proxyListenerConfig);
this.proxyListener.on('connection',
this.frontendManager.onConnection.bind(this.frontendManager));
}
}