Determining a client's IP address

Is it somehow possible to find out the IP address of a client accessing my app on Backendless? For example when they make a request to the Data Service or a custom event handler?

Hi Simon,

No, we do not pass that information to custom business logic in the current implementation. There is an internal ticket request that change, it will be possible soon.

Regards,
Mark

Hi Mark,

I was wondering if this feature has been implemented yet.

Hi Mark,

Has this feature been added yet?

Hi @mark-piller are there any updates on this feature? Thanks!

Hello @William_Lee

Could you check if this code shows your IP?

console.log(
  request.context.httpHeaders['X-Real-IP'],
  request.context.httpHeaders['X-Forwarded-For']
)

Where request is an argument that comes to the API method.

Also how it looks with Codeless:
image

Hi Dima I’m not sure about what I’m doing here. I duplicated the API Service but then I wasn’t sure how to call it or If i needed to add some input header information.



Hello @William_Lee

  1. Create BL Service
  2. Add onClick logic on button in ui-builder
  3. Open browser terminal and open β€œconsole” tab in preview app

Regards,
Viktor

Hi Victor, I restructured codeless like you did and then ran it.
Looks like it returned the URL but not the IP address?

Returned data should be shown in Console tab because we print it. Also, you could find it at Network - Response of your request.


1 Like

Looking about the IP address, I found this solution:

And is easy:

Screen Shot 2022-04-20 at 22.47.16

Please don’t hesitate to ask, Mario