Skip to main content
13-Aquamarine
Apr 4, 2024 8:43 AM UTC
Solved

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

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

nmutterAnswer
17-Peridot
Apr 5, 2024 6:12 PM UTC

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.

 

3 replies

Rocko
19-Tanzanite
Apr 4, 2024 12:42 PM UTC

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.

Translate
nmutter17-PeridotAnswer
17-Peridot
Apr 5, 2024 6:12 PM UTC

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.

 

Translate
17-Peridot
Apr 8, 2024 11:31 AM UTC

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.

Translate