Skip to main content
Glama
conninfo.js655 B
// 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 };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Valerio357/bet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server