0
votes

I have an Azure Cloud Service Virtual Machine with 2 server:

  • Java project using Jetty server at http://localhost:8999
  • ASP.NET MVC project using IIS Express at http://localhost

I am using Http request to make connection between 2 server.

In my VM, inside ASP.NET MVC project, I use http://localhost:8999 to get data from Jetty server. It works perfectly with short response time (from 100ms to 6000ms).

However, when I access the IIS Express via Internet using http://mydomain.cloudapp.net. It does not work anymore.

Then I change my config file in ASP.NET MVC project to use http://mydomain.cloudapp.net:8999. It works but with long response time (from 15s to 40s). This is because of my slow internet connection.

My question is:
If I access IIS Express via Internet, to avoid external internet connection, is there any solution which let IIS Express know that it's target is local?
Which means I can still use http://localhost:8999 in my config file in ASP.NET MVC project, and it still work if I access IIS Express via Internet not only via localhost.

1

1 Answers

0
votes

The main question is how you connect between the two servers? From the client side (JavaScript) or the ServerSide (Controller action/private method).

From what you describe it seems that you make XMLHttpRequest (JavaScript, AJAX, jQuery, etc.) call from your client side directly to your Jetty Server. In order to avoid roundtrips, you have to change this and make XMLHttpRequest to Your Server (MVC), then on the MVC backend (Controller action, or private method, or Repository) make the Jetty server call and transparently return the answer to the calling client.

You can also try tweaking your Jetty Server settings to allow for longer script execution.