mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-15 20:12:06 +00:00
21 lines
623 B
JavaScript
21 lines
623 B
JavaScript
|
|
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));
|
||
|
|
}
|
||
|
|
}
|