Skip to main content
13-Aquamarine
April 4, 2024
Solved

Is there any way to see from what server ip or host name that a request was made from?

  • April 4, 2024
  • 2 replies
  • 1045 views

Hi,

I am doing a request in Thingworx to a server that denies the request. The server in question is configured to only accept requests from a particular server.

 

So my question is, is there any way to see in Thingworx the origin of the request made from Thingworx?

 

Kindly

 

Oskar Berntorp

Best answer by nmutter

Yes, you can create a service with the following content and JSON result

result = Resources["ContentLoaderFunctions"].LoadJSON({url: "https://httpbin.org/ip"});

The server contacted will respond the callers ip. You can check yourself by visiting the url in the browser.

 

2 replies

Rocko
19-Tanzanite
April 4, 2024

Thingworx can't know about the network infrastructure between itself and the server receiving the request, so no, you can't see this in Thingworx.

It could be visible in the error message or in the error log of the remote server.

nmutter16-PearlAnswer
16-Pearl
April 5, 2024

Yes, you can create a service with the following content and JSON result

result = Resources["ContentLoaderFunctions"].LoadJSON({url: "https://httpbin.org/ip"});

The server contacted will respond the callers ip. You can check yourself by visiting the url in the browser.

 

16-Pearl
April 8, 2024

Additional hint: the solution I presented only shows the IP which is used to contact the server (which in this case is in the internet). If your destination server is in your local network the hint will not work.