michangarrito/apps/mcp-server/node_modules/hono/dist/adapter/bun/conninfo.js
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
Marketplace móvil para negocios locales mexicanos.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React Web)
- apps/mobile (Expo/React Native)
- apps/mcp-server (Claude MCP Server)
- apps/whatsapp-service (WhatsApp Business API)
- database/ (PostgreSQL DDL)
- docs/ (Documentación)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:41:02 -06:00

28 lines
655 B
JavaScript

// src/adapter/bun/conninfo.ts
import { getBunServer } from "./server.js";
var getConnInfo = (c) => {
const server = getBunServer(c);
if (!server) {
throw new TypeError("env has to include the 2nd argument of fetch.");
}
if (typeof server.requestIP !== "function") {
throw new TypeError("server.requestIP is not a function.");
}
const info = server.requestIP(c.req.raw);
if (!info) {
return {
remote: {}
};
}
return {
remote: {
address: info.address,
addressType: info.family === "IPv6" || info.family === "IPv4" ? info.family : void 0,
port: info.port
}
};
};
export {
getConnInfo
};