Android connection to localhost

IP-address 10.0.2.2 is used to fetch data from the emulator. Localhost will always point to the emulator/android device running the application. To let your device fetch data from your pc, it should be in the same network (connected by WiFi to your router) and you should use the local IP-address of your pc (normally a … Read more

ASP.NET MVC: How to automatically disable [RequireHttps] on localhost?

The easiest thing would be to derive a new attribute from RequireHttps and override HandleNonHttpsRequest protected override void HandleNonHttpsRequest(AuthorizationContext filterContext) { if (!filterContext.HttpContext.Request.Url.Host.Contains(“localhost”)) { base.HandleNonHttpsRequest(filterContext); } } HandleNonHttpsRequest is the method that throws the exception, here all we’re doing is not calling it if the host is localhost (and as Jeff says in his comment … Read more

Why doesn’t zeromq work on localhost?

As @fdb points out: The problem is at line: subscriber.bind(“tcp://localhost:5555”) try to change to: subscriber.bind(“tcp://127.0.0.1:5555”) However this deserves more explanation to understand why. The documentation for zmq_bind explains (bold emphasis mine): The endpoint argument is a string consisting of two parts as follows: transport://address. The transport part specifies the underlying transport protocol to use. The … Read more