IP instead of localhost - asp.net

I have a sample project (using a webserver) working on localhost:49350
I would like to access that from another computer in the same network. However, entering the IP address instead of localhost (the one i get via cmd--> ipconfig) does not seem to work
(192.168.0.17:49350). I get a bad request (400).
Can anyone help? I am using asp.net web api and I am fairly new to this.
Thanks in advance!
Greets.

Try to open the port (49350) on your router, should be open for TCP.

Related

Web service(asmx) works perfectly on localhost but not on local ip address

As mentioned in the question, I have deployed my service on IIS and using my computer ip address "111.111.111.1:100 and also specify the port (100).
I also checked if the port was listening which it is. The service deploys with no problem. I can also see the asmx file however when I open it is just blank. I have done some research before posting this question but didn't find and valid answer to my question. Hopefully will find it here. Thanks in advance.
Research made
WCF rest web service working on localhost but not on host
https://social.msdn.microsoft.com/Forums/en-US/823b076c-160d-4f52-86ad-c84dfb91accb/webservice-running-on-localhost-but-not-running-with-full-server-name?forum=biztalkgeneral
Did you check your firewall settings? Maybe the firewall is blocking the port you are using

Access localhost of another computer

We are not on the same network. Website uses WebRTC and Janus-Gateway. I tryed using ngrok and tools like that. But even if i point ngrok to janus-gateway and it CAN connect, webrtc data still doesn't send.
What would be a solution for this?
Thanks!
P.S I am accessing the other computer Trough RDP(Remmina), maybe that could be of some use?
Resolved(was problem in my endpoint urls).

OWIN self hosted doesn't receive connections from outside

I have a project which is made of a console application which listens to a port and acts when a message is received.
The messages are received from an asp.net web api based web site.
Both work properly together.
I wanted to combine both solutions into one executable file.
To accomplish that I used OWIN self hosted solution.
I managed to merge the web site into the console application and when working from my local machine I manage to see the web site and everything works well.
The problem occurs when I try to open the website from another machine\device connected to my LAN.
I get no response. I know it is not a firewall issue since my OWIN self hosted using the standalone website's port (I put the website down to make the port available).
This problem didn't occur when both solution where seperate.
I assume it is an owin configuration issue.
I tried to use the following code but I get access denied exception.
options.Urls.Add($"http://{Dns.GetHostName()}:{port}");
options.Urls.Add($"http://localhost:{port}");
If I use only
options.Urls.Add($"http://localhost:{port}");
There is no exception and it works from my computer as expected but not from another machine.
I did some search but didn't manage to make it work.
Any kind of assistance will be appreciated.
Thanks in advance!
you can either use specific ip-address or use * to listen on a port
I use below code for specific ip-address
var ip = Dns.GetHostEntry(Dns.GetHostName());
var ipaddress = ip.AddressList.FirstOrDefault(x => x.AddressFamily == AddressFamily.InterNetwork);
options.Urls.Add($"http://{ipaddress}:{port}");
or you can also do
options.Urls.Add($"http://*:{port}");
Open the ports on the firewall and
instead to use it
WebApp.Start("http://localhost:8080/");
Use it:
WebApp.Start("http://*:8080/");

How to view webpage on my server from another computer?

I have a web application I have developed on a server on my home computer. Is it possible to access that web page from another computer on my home network?
My naive approach was just enter my ip address followed by the port number :8888 which the server is listening on...
Any help would be great thank you.
I don't know if it will help but you can use an ssh connection to your computer. But you need to do it from a shell (from terminal on a mac, use putty on a PC)
In the end it was easier to set up remote access to the server by setting up port-forwarding on my router and using no-ip for DNS management. They have a decent walkthrough to get it all up and running. So i simply have to type in my-address.no-ip.org to access my site from any remote device.
Otherwise the links to questions on superuser that Sampo posted are worth a try.

Accessing ASP.NET website from LAN

I have tried to access a website that i created in my xp machine that have iis 5.1 from the LAN , but without any success i have tried what is suggested in the following link How to access your website through LAN in ASP.NET , but also without any clue . I open my site in my PC(locally) like this "192.168.1.252/pse" and it works , but from other pc in the LAN , its not displayed at all.
Any Help will be most appreciated.
Thanks,
Saed
Is your Windows Firewall turned on?
You say, "its not displayed at all". What happens instead of it being displayed? Is there an error message?
Most likely, your firewall software is blocking external access. If external users can find your machine using ping, then that suggests a firewall is blocking access.
Please do what the two previous posts suggested, check to see if you can ping your computer from a different computer within the network and then check your firewall also.
When you are done checking the above suggestions, if you still have trouble viewing your page from a different computer, check to see if your computer has port 80 open. And if it is using port 80 and everything looks ok, please provide the error number you are receveiving, I am guessing it is 404 - Page not found.
Hope this helps!
It was firewall and Antivirus problem , they were blocking the port 80.
Thanks All for your Help.
Saed

Resources