INNER CODE UNIT · TypeScript
match
lazy-dinosaur/ccxt-mcp · src/index.ts:111
const match = auth.match(/^Bearer\s+(.+)$/i);
if (!match) return null;
const token = match[1].trim();
return token || null;
}
async function startSseServer() {
const effectiveConfigPath = resolveConfigPath();
const expectedBearerToken = readMcpBearerTokenFromConfig(effectiveConfigPath);
const sessions = new Map<string, { transport: SSEServerTransport; mcpServer: CcxtMcpServer }>();
const httpServer = createServer(async (req: IncomingMessage, res: ServerResponse) => {
try {
const requestUrl = new URL(req.url || "/", `http://${req.headers.host || "localhost"}`);
const presentedBearerToken = readBearerTokenFromHeader(req);