H
H
Hakito2015-11-14 12:25:31
Android
Hakito, 2015-11-14 12:25:31

How to connect to ASP.NET server from phone?

Wanted to implement REST API. Created an asp.net mvc 4.0 project in the studio. The controller is there by default, it can be accessed from the browser via localhost:[port]/api/values. Everything works fine on the computer, but when I try to make a request from the phone, it throws the error "failed to connect to /192.0.57.37 (port 57826) after 90000ms: isConnected failed: ETIMEDOUT (connection timed out)". The firewall is turned off, the Internet is on the phone and on the computer, permissions are added in the manifest on the phone. This is my first time doing this, maybe something else is wrong. Tell me, please, what is the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Artem Kuryanov, 2015-11-18
@kurt_mt

By default, a project launched in the studio listens only to local connections. Dances with a tambourine are described here: https://web.archive.org/web/20120619052129/http://...

F
Fredcapit, 2015-11-19
@Fredcapit

Generally what is running on localhost on port like 56870 is for debugging your Web application locally. In order for your other devices to access this application, you need to publish your site on your IIS (Internet Information Sevice), unless of course you have it installed (if not, it's easy to do in programs and components, a button like "Add or Remove components")
Learn how to configure iis, and publishing from Visual Studio is quite simple (publish button, a dialog box will appear and follow the instructions, if something is not clear, then google it).
After these steps, your site will spin on your computer and if you have Wifi, then in the phone's browser just write the local IP address of your PC, press "Enter" and voila.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question