bdy 1.9.2-dev → 1.9.3-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.9.2-dev",
4
+ "version": "1.9.3-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -76,6 +76,15 @@ class ApiSocketClass extends events_1.default {
76
76
  // do nothing
77
77
  }
78
78
  }
79
+ connect() {
80
+ setTimeout(() => {
81
+ this.socket.io.open((err) => {
82
+ if (err) {
83
+ this.connect();
84
+ }
85
+ });
86
+ }, 3000);
87
+ }
79
88
  constructor(host, id, token) {
80
89
  super();
81
90
  this.id = id;
@@ -91,11 +100,11 @@ class ApiSocketClass extends events_1.default {
91
100
  }, MAX_REQUESTS_SYNC_WINDOW);
92
101
  this.socket = (0, socket_io_client_1.io)(host, {
93
102
  forceNew: true,
94
- autoConnect: true,
103
+ autoConnect: false,
95
104
  autoUnref: true,
96
105
  forceBase64: true,
97
106
  transports: ['websocket'],
98
- reconnection: true,
107
+ reconnection: false,
99
108
  rejectUnauthorized: false,
100
109
  agent: new https_1.Agent({
101
110
  rejectUnauthorized: false,
@@ -118,6 +127,7 @@ class ApiSocketClass extends events_1.default {
118
127
  this.connected = false;
119
128
  logger_js_1.default.info(texts_1.LOG_SOCKET_DISCONNECTED);
120
129
  this.emit(utils_1.SOCKET_IO_EVENT_DISCONNECTED);
130
+ this.connect();
121
131
  });
122
132
  this.socket.on('fetchTunnelAgentSuccess', (data) => {
123
133
  logger_js_1.default.debug('Socket fetch success');
@@ -128,6 +138,7 @@ class ApiSocketClass extends events_1.default {
128
138
  this.emit(utils_1.SOCKET_IO_EVENT_FETCH_FAILED, (0, utils_1.apiErrorCodeToClass)(code, host));
129
139
  });
130
140
  this.socket.on('sync', (data) => this.onSync(data));
141
+ this.connect();
131
142
  }
132
143
  }
133
144
  exports.default = ApiSocketClass;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.9.2-dev",
4
+ "version": "1.9.3-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {