skip to Main Content

Good night.

I’m currently developing an app with Angular15 as frontend and an ASP.NET API as backend. Both are deployed in IIS v8.5 servers.

Recently, I have found that when my companions enter the app to do some tests, the REST requests that are sent to the backend are being done with my companions IP instead of doing it with the server IP where the frontend is deployed.

This is causing some troubles so I want to know if there is a way to make the Angular frontend do all the requests with the server IP instead of doing it with the client IP.

Thank you!

#Update1
This is the way I’m doing the REST calls:

In .ts:

this.persistenceService.save(this.info).subscribe(
      data => {
        console.log(data);
      });

In persistenceService:

save(info: CustomObject): Observable<any> {
return this.http.post('https://backend.com', info, {headers: {'Content-Type': 'application/json'}});
}

2

Answers


  1. Chosen as BEST ANSWER

    I could finally solve it with a reverse proxy, as @TengFeiXie said.


  2. When you visit a web application whats happens is that web app is physically downloaded onto your computer from the server where it is deployed and the application runs in your browser and all the requests that the app makes go through the browser thus are made from your computer thought your IP address. This is always the case with the Internet communication. If you want your app to be accessible only from a certain network then what you have to do is to setup a a VPN that your companions can join and then they will get their IP addresses from the address space of the network.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search