EO-Client-IP
activated in the rule engine, and assembled into data in the form of JSON to respond to the clients, which succeeds in obtaining client IP address by the use of edge function. addEventListener('fetch', event => {event.respondWith(handleRequest(event.request));});function handleRequest(request) {// Obtain the client IP through the EO-Client-IP headerconst ip = request.headers.get('EO-Client-IP') || '';// Respond with JSON datareturn new Response(JSON.stringify({ ip }), {headers: { 'content-type': 'application/json' },});}
EO-Client-IP
in the Rule Engine configuration. https://example.com/ip
) which matches the trigger rule of the edge function in the address bar of the browser on both the PC and mobile terminal to obtain the client's IP address:
Was this page helpful?