Web Api Service self hosted in Windows Service - asp.net-web-api

Web Api Service self hosted in Windows Service doesn't work with port forwarding, keeps saying connection actively refused. If you use the machine url directly works fine. If you use router url/port, which is port forwarded to web api service machine where selfhosting is taking place. The connection problem appears. To me this looks like the web api service can't recognize the port forwarding.

Related

IIS hosted Web Application cannot accessible through Internet

I have hosted Flask Web application on Windows Server on AWS, I have done followings
hosted it on IIS and add new bindings(port 8090) to web site
Created inbound rule for the port(8090) given in bindings
And it works fine on the server, but when i'm trying to access it on my PC's web browser says
it cannot reach took too long to respond
What else i need to do ?
In your vm, different provider has their security policy. For aws even you have set inbound port rule, it will not work. You also need to set inbound rules in their potal.
👉(1) Open Windows firewall, Create an Inbound Port Rule.
👉(2) Directly in Amazon Web Service console, exactly in security groups/inbound.

No response while using ngrok to expose a local web server

I'm trying to expose my local web server IIS Express using ngrok.
Followed steps from https://ngrok.com/docs and fired the tunnel, but can't get response.
Screenshot - ngrok fired
I'm using Visual studio via IIS Express. (Debug mode, local website works well.)
If local website not started, access to XXXXX.eu.ngrok.io will get error directly:
Failed to complete tunnel connection
The connection to https://2713343d.eu.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:44320.Make sure that a web service is running on localhost:44320 and that it is a valid address.The error encountered was: dial tcp [::1]:44320: connectex: No connection could be made because the target machine actively refused it.
No errors shows on Ngrok's Web Interface too.
Is there any way to check where the problems are? or see ngrok's log?
Indeed it works with http, but it is strongly recommended to work with https, so you should properly start ngrok in order to work with https:
ngrok http -host-header=localhost https://localhost:{your_IIS_express_port}
After this you should be able to access your URL:
https://{id}.ngrok.io
Credits
Try make your service as http, not https.

Secure communication on tclhttpd server fails

I have a tclhttpd server and I am trying to communicate it using secure server (SSL). When I start my server, I get a notification that:
httpd started on port xxxx
secure httpd started on SSL port yyyy
When I try to access the normal HTTP (http://localhost:xxxx), I can access the web folder. However, when I am trying to access the web server through a browser using secure port and https (https://localhost:yyyy) it shows:
The connection to localhost was interrupted while the page was loading.
I've also used the Httpd_SecureServer call to initialize the server but i still cannot connect using ssl.
What am I doing wrong here? any ideas?

How can I call WEB api service fabric which deployed on azure?

I have created locally stateless WebAPI and Statefull data service with the Visual Studio 2015. It is working perfectly in the local system and website access WebAPI service by implementing http://localhost:344/api/abc/getEmployee. Then I deployed service fabric application on Azure and received client URL
http://xyz.southeastasia.cloudapp.azure.com:1900/Explorer/index.html#/abc.apptype/app/abc.app/service/abc.app%252webservices
My problem is that how can I call my WebAPI controller and action from this Azure client URL?
http://xyz.southeastasia.cloudapp.azure.com:1900/api/abc/getEmployee is not working.
Note: This url is not secure and will use by mobile and website.
You're using the wrong port to access your application. Port 19000 is a Management endpoint.
Read this to setup your API. Run your app at port 80 (if possible),
Make sure that the Azure Load Balancer has a load balancing rule for port 80 external to port 80 on the cluster nodes. More info here.
You need to configure an inbound TCP rule for the port you want to use. Typically you will map an inbound port (such as port 80) to the port that your application is listening on (e.g. 344).
In the Azure management portal, find the resource group of your deployed Service Fabric service; in it, there should be a "Load Balancer" resource. -- Click on that.
In there, you should find a pane called "Load Balancing Rules" (it's easy to look past it with the light gray icon, it's right above "Inbound NAT Rules").
Using the button at the top of the configuration blade, "Add" a rule for the port that you need opened; You should give it a meaningful name (such as HTTP or WebAPI, etc.) -- for "Port" this is the publicly facing port that you want mapped (e.g. port 80 for HTTP), and for Backend port, you can put the port that you're actually listening on (e.g. 344).
Finally, don't expect it to work right away. -- You will see a little "Updating" bar, you have to wait for that to finish.

Access to a self-hosted WCF service on azure virtual machine over the Internet

Actually the question is kind of duplication of the following one Unable to access a locally hosted wcf service over the internet but with only difference that the service is hosted by a windows service on Azure Virtual Machine.
I can access the service on the machine and I have added an endpoint to the service port at Azure Configuration console, but still cannot access the service over the Internet.
The error message that is not possible to set up connection.
Is my scenario technical possible on azure? if yes - what is done wrong?
The answer to my question was pretty straightforward. Although I opened my endpoint in Azure Management Console the port was blocked by the virtual machine firewall (windows firewall). After setting in- and out- tcp port rule, the problem had gone.

Resources