tetherdb 0.1.0 → 0.1.1

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.
@@ -1615,8 +1615,6 @@ var TetherServer = class {
1615
1615
  this._webSocketServer?.handleUpgrade(req, socket, head, (ws) => {
1616
1616
  this._webSocketServer?.emit("connection", ws, req);
1617
1617
  });
1618
- } else {
1619
- socket.destroy();
1620
1618
  }
1621
1619
  });
1622
1620
  }
@@ -1704,6 +1702,23 @@ var TetherServer = class {
1704
1702
  }
1705
1703
  });
1706
1704
  }
1705
+ /**
1706
+ * Creates a Connect- and Express-compatible HTTP middleware handler.
1707
+ *
1708
+ * @returns Middleware function `(req, res, next) => void`.
1709
+ */
1710
+ createMiddleware() {
1711
+ return (req, res, next) => {
1712
+ this.handleHttpRequest(req, res).then(
1713
+ (handled) => {
1714
+ if (!handled) next();
1715
+ },
1716
+ (err) => {
1717
+ next(err);
1718
+ }
1719
+ );
1720
+ };
1721
+ }
1707
1722
  /**
1708
1723
  * Handles incoming HTTP requests for authentication and discovery endpoints.
1709
1724
  *