Community discussions

MikroTik App
 
radiomi
just joined
Topic Author
Posts: 3
Joined: Tue Nov 08, 2022 9:04 pm

Tool fetch returns error "status: failed" when trying to reach endpoint at localhost program

Tue Apr 30, 2024 6:58 pm

Good morning.

I'm currently using a laptop connected via WiFi to a router. Let's suppose that the laptop has been assigned the address
X.Y.Z.T
(which is contained in the network
192.168.11.0/24
). Let's suppose that the CHR has the address 192.168.11.1/24 assigned to the interface "ether1".

In that laptop, I have set up a MikroTik CHR (using VirtualBox - Bridge Adapter). I can successfully connect to said CHR via WinBox in my laptop. Additionally, the CHR can ping the laptop successfully.

The laptop runs a program in C# with a single available "GET" endpoint: "HomeController1". When running the program from desktop, I can successfully reach the endpoint by using PostMan. Specifically, the PostMan call that I use is the following:
https://localhost:7250/HomeController1
.

However, if I try to fetch the API from the CHR, I get the error "status: failed; connection refused". The command that I'm using is the following:
/tool fetch url="https://X.Y.Z.T:7250/HomeController1 check-certificate=no
.

Regarding the MikroTik configuration, I have not set up anything special other than indicating this route:
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=ether1 routing-table=main \
    suppress-hw-offload=no
Furthermore, the Windows firewall is disabled, so I can't quite understand why the API endpoint can't be fetched successfully. Is there any extra configuration I can set up?

Thank you very much for your attention and best regards.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11770
Joined: Thu Mar 03, 2016 10:23 pm

Re: Tool fetch returns error "status: failed" when trying to reach endpoint at localhost program  [SOLVED]

Tue Apr 30, 2024 8:24 pm

Can you fetch data from X.Y.Z.T:7250 using another computer from same subnet? It is possible that your API server only binds to loopback interface (127.0.0.1 a.k.a. localhost).
 
radiomi
just joined
Topic Author
Posts: 3
Joined: Tue Nov 08, 2022 9:04 pm

Re: Tool fetch returns error "status: failed" when trying to reach endpoint at localhost program

Tue Apr 30, 2024 9:45 pm

Good afternoon, mkx. That seemed to be the case. I could not reach the server from a device other than localhost. After reviewing the app configuration, the issue has been solved.

Thank you very much for your time and best regards!

Who is online

Users browsing this forum: No registered users and 20 guests