powershelltcpf#suave

client is waiting forever for remote server to return a webpage


I have an application with a server written in F# and serve web files using suave. I remote login using powershell into another machine in the network to run the application (The application is also in one of the network drives). I do that because that machine have access to third party APIs needed for the server. Now when I do [IPAddress_Of_Remote_Machine]/[html_file] or [name_of_pc]/[html_file] then chrome is waiting forever and doesn't ever return the webpage. This wasn't happening before and I ran into this problem recently. I opened a different port and used it instead of the default one 80. This made things work but the problem keeps showing up after a couple of days. I don't think it's a firewall issue but I'm clueless to why this is happening.

When running netstat -an, this is what I get (I hid the IP address):

enter image description here

As you can see all of the connections are either in CLOSE_WAIT or ESTABLISHED but not LISTENING. All of these TCP connections is probably because I have PhantomJS and two other APIs running in the application as well. However the loop back address is also open on the same port 5959: enter image description here

I'm not sure what is difference between these two but when using PortQryUI to query the remote server it returns a success!

enter image description here

I have already made an inbound rule for port 5959 on the server so it should be allowed. The web page is stuck at Waiting for [name_of_pc]. Also, sometimes this problem disappears and everything works fine.

What is the potential problem behind this? Why would this happen all of a sudden?

UPDATE:

I re-ran the application today and it's working correctly. It could be that something is dynamically set within the firewall? Not really sure what is going on. The machine I'm running the server on has a bunch of applications running on it as well so maybe there is an external process that is affecting it?

I made a hello world app with Suave and deployed it on the network drive to test if it's going to work. I opened inbound rule for port 6001 enter image description here

Then I ran the app: enter image description here

However, it's still not working and this time it says the site cannot be reached when I do: http://[name_of_pc]:6001.

enter image description here


Solution

  • Moving this to an answer so that it can be closed:

    Could you post the bindings section of your suave cfg? I'm guessing you know where that is since you are using a non-standard port but if you need don't, search for HttpBinding. I suspect you will find it pointing to 127.0.0.1 which is not good enough for remote access. You could try changing it to 0.0.0.0 or to the server's actual IP address. I would try 0.0.0.0 first for the flexibility it provides