I am try to set custom DNS suffix (yahoo.com in my case) using adb command
setprop net.dns.search yahoo.com
I verified it using
getprop net.dns.search
and it returns yahoo.com
However, when I type music in my browser and run tcpdump in the adb, here is what I get.
So, the query is actually "music.yahoo.com", but somehow, the android default browser says page not found
Why is it not going to music.yahoo.com when the actual query is that?
When I set the suffix to google.com and enter finance in my browser. It just opens google.com and not finance.google.com
Do anyone have any idea of what could be wrong? Any help is much appreciated!!
You are confusing something maybe. net.dns.search adds suffix to searched host names. You pass music, it will append yahoo.com. Ok, you got music.yahoo.com in DNS, but programs thinks it is music.
In HTTP, you specify which host you connect to. And there will be Host: music. Not music.yahoo.com. Server receives music and don't know for which virtual server it should be. Thus it uses default site as fallback.
Is there reason you want it to behave this way? It is intended to save your own time by setting your local domain. But it will not work well on public internet.
Related
I do some automated tasks an android over adb commands, at one part i need to access a webview inside the app and control it. Until now i did these things:
I get the running webview processes with this command adb shell cat /proc/net/unix
For each process i do a protforwarding with this command adb forward tcp:9222 localabstract:webview_devtools_remote_25866
I do a get request to http://localhost:9222/json and get an array with webvies accessible over this proccess (so i clould check the title and the attaced state to find the right one)
My problem is now that since a few days I always get an empty array. I still able to see the webvies at chrome://inspect/#devices and can connect.
Does anyone have an idea why i only get an empty array or know an alternative solution?
In the meantime I have found the problem. The app I control no longer uses a webview but a browser popup, so it can't be found via the search with webview.
Have created a simple GET API using node.js and trying to consume it within my expo-react native project using axios/fetch.
The GET API is called whenever user clicks on submit button.
Submit -> http://localhost:port/api
However, when I am trying to test the feature on my android device by connecting the device through datacable and selecting "local" connect type in expo, the API call always falls under exception.
When I tried to log the exception, the exception is printed empty.
I double checked the API and it works fine when tested through postman.
I tried replacing localhost url with my-Ip (http://IP:port/api) and also with 127.0.0.1/127.0.2.2 (http://127.0.0.1:port/api , http://127.0.2.2:port/api) , but nothing seems to make the API call a success.
When I replaced the localhost URL with Facebook's network sample API, the application worked just fine. So, there is no issue with the API calling method.
Also, tried adding the port to windows inbound firewall request but that didn't work too.
Can someone help me out with this ?
You must call the API from your local IP address. To get your local IP, just do the following:
If you are on Ubuntu 16.04:
ifconfig | grep 192
If you are on Ubuntu 18.04:
ip -c a | grep 192
Your local IP address will probably be something like 192.168.0.XXX.
yes, i also had this problem until use my Local IP (example: http://192.168.1.55:port) instead 127.0.0.1
please see this answer
Good day,
This is working
I use my machine's IP the Ethernet adapter Ethernet 2: IPV4 Address
And allow my port on firewall both Inbound and outbound rules
I want to implement chat in my android app using SignalR and I download this example from asp.net:
https://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr
But I can't acces to it using localhost through HubConnection. I tried using my IP adress and port number but it's not working. Does anyone has experience with this?
Thanks!
Assuming your app server is IIS Express, it won´t work by default because of network restrictions or even the firewall.
First thing, as you already realized, the client needs to connect with your machine ip, not localhost. Something like http://x.x.x.x:port/signalr
Then you need to make sure your machine is accesible from the mobile phone or emulator: open a browser in the phone and type a known address, like http://x.x.x.x:port/somethingThatExists.
If that url is not available:
Try disabling the firewall
Open powershell at the machine runing IIS-Express and run this: netsh http add urlacl url=http://{your server ip}:{port}/ user=everyone. (if your system language is not english, for instance: spanish, change "everyone" to "todos")
Open the file applicationhost.config in your directory solution Solution/.vs/config/applicationhost.config and search for the application xml node. Something like <site name="YourAppName" id="1">...</site>. You´ll see the localhost binding by default. Add a new one with the actual ip: <binding protocol="http" bindinginformation="*:port:x.x.x.x"></binding> (make sure the ip/port are correct. i.e: *:57457:192.168.0.57)
Restart IIS Express and try again (no need to reboot the system)
I made a webserver on my android device(using Nanohttpd). It's working fine over the port 8080
but I want to make it okay over the port 80,(I want to tape on my browser : http://192.168.x.x instead of http://192.168.x.x:8080/ ) but I'm not able to do it
This is how I call the method that creates the webserver:
httpServer = new NanoHTTPD(80,Environment.getExternalStorageDirectory());
Can someone tell me what service is running by default over the port 80 ?
How can i fix this problem ?
I finally found a way to fix that, for those who have the same problem, here is the solution
I rooted the phone using UnlockRoot
then I installed Port redirector from the play store and I forwarded the traffic from port 80 to port 8080, and now my web server is available from the address: 192.168.x.x
Hope it will help :)
Ports below 1024 are restricted on Unix like systems. You need superuser privileges to bind to these "well-known" ports.
List of these "well-known" ports on wikipedia
Check out line 89 of the server source:
https://github.com/NanoHttpd/nanohttpd/blob/master/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
I don't even see a constructor that type-matches your arguments. That might be part of the problem.
What does this mean, "android_358920041107720" and how do I get rid of this string when starting my Terminal?
I believe it came from me downloading PhoneGap/Cordova, but not entirely sure.
Any help or explanation of what I'm looking at would be greatly helpful!
Thanks.
Link to the image: http://cl.ly/image/321r1O003n13
That is an android host name identifier when requesting DHCP lease on the IP address... see this for example, that occurs on my network.
dhcpd: DHCPACK on 192.168.x.x to xx:xx:xx:xx:xx:xx
(android-acc87f3d476374c1) via eth0
It could also be used to signify the Android's host name from within the adb shell, depending on the flavour of the ROM and version used.