@hono/node-server 1.13.5 → 1.13.6

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/conninfo.js CHANGED
@@ -25,17 +25,14 @@ __export(conninfo_exports, {
25
25
  module.exports = __toCommonJS(conninfo_exports);
26
26
  var getConnInfo = (c) => {
27
27
  const bindings = c.env.server ? c.env.server : c.env;
28
- const address = bindings.incoming.socket.address();
29
- if (!("address" in address)) {
30
- return {
31
- remote: {}
32
- };
33
- }
28
+ const address = bindings.incoming.socket.remoteAddress;
29
+ const port = bindings.incoming.socket.remotePort;
30
+ const family = bindings.incoming.socket.remoteFamily;
34
31
  return {
35
32
  remote: {
36
- address: address.address,
37
- addressType: address.family === "IPv4" ? "IPv4" : address.family === "IPv6" ? "IPv6" : "unknown",
38
- port: address.port
33
+ address,
34
+ port,
35
+ addressType: family === "IPv4" ? "IPv4" : family === "IPv6" ? "IPv6" : void 0
39
36
  }
40
37
  };
41
38
  };
package/dist/conninfo.mjs CHANGED
@@ -1,17 +1,14 @@
1
1
  // src/conninfo.ts
2
2
  var getConnInfo = (c) => {
3
3
  const bindings = c.env.server ? c.env.server : c.env;
4
- const address = bindings.incoming.socket.address();
5
- if (!("address" in address)) {
6
- return {
7
- remote: {}
8
- };
9
- }
4
+ const address = bindings.incoming.socket.remoteAddress;
5
+ const port = bindings.incoming.socket.remotePort;
6
+ const family = bindings.incoming.socket.remoteFamily;
10
7
  return {
11
8
  remote: {
12
- address: address.address,
13
- addressType: address.family === "IPv4" ? "IPv4" : address.family === "IPv6" ? "IPv6" : "unknown",
14
- port: address.port
9
+ address,
10
+ port,
11
+ addressType: family === "IPv4" ? "IPv4" : family === "IPv6" ? "IPv6" : void 0
15
12
  }
16
13
  };
17
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/node-server",
3
- "version": "1.13.5",
3
+ "version": "1.13.6",
4
4
  "description": "Node.js Adapter for Hono",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",