I'm using bun v0.1.7 (NOT nodejs), I'm trying the built-in basic http server without any other framework:
export default {
port: 3000,
fetch(request: Request) {
const remoteIp = request.headers.get('x-forwarded-for') || 'UNKNOWN';
return new Response(remoteIp);
},
};
Can I get the remote IP from the client when I'm not using any proxies ?
I've tried request.connenction.remoteAddress
, request.socket...
But nothing seems to be implemented.