Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind to something else than localhost #799

Closed
jurij opened this issue Aug 5, 2015 · 9 comments
Closed

Bind to something else than localhost #799

jurij opened this issue Aug 5, 2015 · 9 comments

Comments

@jurij
Copy link

jurij commented Aug 5, 2015

Hi,

im using this project.json:

"commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
},

with the following hosting.ini:

server=Microsoft.AspNet.Server.WebListener
server.urls=http://localhost:5000

I tried to access http://myip.local:5000/api/values

but im getting:

Bad Request - Invalid Hostname

HTTP Error 400. The request hostname is invalid.

only http://localhost:5000/api/values is working

suggestions?

@jurij
Copy link
Author

jurij commented Aug 5, 2015

One more thing: I dont want to use IIS Express

@Eilon
Copy link
Member

Eilon commented Aug 5, 2015

@Tratcher can you take a look?

@Tratcher
Copy link
Member

Tratcher commented Aug 5, 2015

Change server.urls=http://localhost:5000 to server.urls=http://*:5000, but if you do that you'll need to run the process (or VS) as admin.

Here's a write-up for configuring Http.Sys:
https://katanaproject.codeplex.com/wikipage?title=Selfhosting

@jurij
Copy link
Author

jurij commented Aug 7, 2015

thank you, its working now.

@jurij jurij closed this as completed Aug 7, 2015
@stantoxt
Copy link

That's Greate! I am wondering when i start the server with kestrel,It works both without changing server.urls=http://localhost:5000 to server.urls=http://*:5000.

@Tratcher
Copy link
Member

Kestrel uses raw sockets and only looks at the port (currently), so localhost vs * doesn't make a difference. That will change. aspnet/KestrelHttpServer#98

@stantoxt
Copy link

Tratcher,Thanks.I've learned a lot.

@robie01
Copy link

robie01 commented Sep 30, 2017

Hi i've build project in angular but couldn't see the changes in my browser. I have tried to debug and I got this error: Pls anyone can help me?
Chrome 61.0.3163 (Mac OS X 10.12.5): Executed 0 of 4 SUCCESS (0 secs / 0 secs)
Chrome 61.0.3163 (Mac OS X 10.12.5) ERROR
Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ng:///DynamicTestModule/VideoComponent.ngfactory.js'.
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2736
Chrome 61.0.3163 (Mac OS X 10.12.5) ERROR
Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ng:///DynamicTestModule/VideoComponent.ngfactory.js'.
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2736
Chrome 61.0.3163 (Mac OS X 10.12.5): Executed 0 of 4 ERROR (0 secs / 0 secs)
Chrome 61.0.3163 (Mac OS X 10.12.5) ERROR
Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ng:///DynamicTestModule/VideoComponent.ngfactory.js'.
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2736
Chrome 61.0.3163 (Mac OS X 10.12.5): Executed 0 of 4 ERROR (0.106 secs / 0 secs)
30 09 2017 22:07:53.797:INFO [Chrome 61.0.3163 (Mac OS X 10.12.5)]: Connected on socket X3F_mCPDoS6rRil5AAAB with id manual-4403
Chrome 61.0.3163 (Mac OS X 10.12.5): Executed 0 of 4 SUCCESS (0 secs / 0 secs)

@Eilon
Copy link
Member

Eilon commented Oct 2, 2017

@robie01 can you share more info about your project, such as which version of ASP.NET Core you're using, whether you use the "Angular SPA" project template, etc.?

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
@ghost ghost deleted a comment Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants