Initial sioconfig migration work
This commit is contained in:
parent
dacda65961
commit
40e2a608f6
8 changed files with 111 additions and 18 deletions
23
src/configuration/ioconfig.js
Normal file
23
src/configuration/ioconfig.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export default class IOConfiguration {
|
||||
constructor(config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
getSocketURL() {
|
||||
return this.config.urls[0];
|
||||
}
|
||||
}
|
||||
|
||||
IOConfiguration.fromOldConfig = function (oldConfig) {
|
||||
const config = {
|
||||
urls: []
|
||||
};
|
||||
|
||||
['ipv4-ssl', 'ipv4-nossl', 'ipv6-ssl', 'ipv6-nossl'].forEach(key => {
|
||||
if (oldConfig.get('io.' + key)) {
|
||||
config.urls.push(oldConfig.get('io.' + key));
|
||||
}
|
||||
});
|
||||
|
||||
return new IOConfiguration(config);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue