bit-office 0.1.7 → 0.1.8
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.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/web/out/404.html +2 -2
- package/dist/web/out/_next/static/chunks/app/office/{page-576a0f6864a5fc48.js → page-81d7bad541583f85.js} +1 -1
- package/dist/web/out/index.html +2 -2
- package/dist/web/out/index.txt +1 -1
- package/dist/web/out/office.html +2 -2
- package/dist/web/out/office.txt +2 -2
- package/dist/web/out/pair.html +2 -2
- package/dist/web/out/pair.txt +1 -1
- package/dist/web/out/sw.js +1 -1
- package/package.json +1 -1
- /package/dist/web/out/_next/static/{QSSYYk4eRRYqGdbhctTgP → Ini5NsYvSy_jIXndBUoc4}/_buildManifest.js +0 -0
- /package/dist/web/out/_next/static/{QSSYYk4eRRYqGdbhctTgP → Ini5NsYvSy_jIXndBUoc4}/_ssgManifest.js +0 -0
package/dist/index.js
CHANGED
|
@@ -4331,7 +4331,7 @@ var wsChannel = {
|
|
|
4331
4331
|
async init(commandHandler) {
|
|
4332
4332
|
onCommand = commandHandler;
|
|
4333
4333
|
return new Promise((resolve2) => {
|
|
4334
|
-
const
|
|
4334
|
+
const requestHandler = async (req, res) => {
|
|
4335
4335
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
4336
4336
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
4337
4337
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
|
|
@@ -4423,10 +4423,11 @@ var wsChannel = {
|
|
|
4423
4423
|
return;
|
|
4424
4424
|
}
|
|
4425
4425
|
await serveStatic(req, res);
|
|
4426
|
-
}
|
|
4426
|
+
};
|
|
4427
4427
|
const maxRetries = 10;
|
|
4428
4428
|
let port = config.wsPort;
|
|
4429
4429
|
const tryListen = () => {
|
|
4430
|
+
const httpServer = createServer(requestHandler);
|
|
4430
4431
|
httpServer.listen(port, () => {
|
|
4431
4432
|
config.wsPort = port;
|
|
4432
4433
|
wss = new WebSocketServer({ server: httpServer });
|
|
@@ -4455,7 +4456,6 @@ var wsChannel = {
|
|
|
4455
4456
|
const oldPort = port;
|
|
4456
4457
|
port++;
|
|
4457
4458
|
console.log(`[WS] Port ${oldPort} in use, trying ${port}...`);
|
|
4458
|
-
httpServer.close();
|
|
4459
4459
|
tryListen();
|
|
4460
4460
|
} else {
|
|
4461
4461
|
console.error(`[WS] Failed to start server:`, err.message);
|