mirror of
https://github.com/p-stream/simple-proxy.git
synced 2026-01-11 20:10:35 +00:00
10 lines
300 B
TypeScript
10 lines
300 B
TypeScript
import { EventHandlerRequest, H3Event } from 'h3';
|
|
|
|
export function getIp(event: H3Event<EventHandlerRequest>) {
|
|
const value = getHeader(event, 'CF-Connecting-IP');
|
|
if (!value)
|
|
throw new Error(
|
|
'Ip header not found, turnstile only works on cloudflare workers',
|
|
);
|
|
return value;
|
|
}
|