connection refused error while accessing adapter from app - android

I have an adapter on my worklight server which is publicly hosted and my adapter is using some external ip 164.100.XXX.XX:9090 , now when i am trying to access that adapter from my mobile phone i am getting following error in logs
11-19 03:47:01.499: E/NONE(2363): Procedure invocation error. Runtime:
Http request failed: org.apache.http.conn.HttpHostConnectException:
Connect to 164.100.XXX.XX:9090 [/164.100.XXX.XX] failed: Connection
refused: connect
what do i need to configure on worklight server to unlock ip and port

You do not configure anything in the MobileFirst Server for this.
If an IP address is not available, that means it is not really the correct IP address to use... you need to double-check the IP address and its port. You need to verify that's really an external, public, IP address. 164.0.0... does not seem external at all.

Related

Getting "You don't have permission to access that port" error in Django

I want to run my Django API to my IP address which is 192.168.1.5:81 with port number but I am getting that You don't have permission to access that port.
I have done port forwarding in my router.
I am doing this because I want to get data in my Android application using retrofit.
i checked my available ports on my IP address then i ran code with the open port and solved this.
also i added my IP address inside ALLOWED_HOSTs in settings.py file

Android app failed to connect to local server over WIFI

I'm developing an Android app that must connect to the server to retrieve some data. I've 2 devices connected on my local WIFI via a router: My development laptop (as server) and my development android phone (as client). The laptop has as IP address 192.168.41.50 and my Apache HTTP server is running on port 81.
My problem is the following:
If I run my android application to retrieve data into the server, it doesn't work, it's giving me a timeout exception:
D/OkHttp: <-- HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /192.168.43.50 (port 81) after 120000ms
But the same address is working on the laptop's browser
How can I solve this problem.
Have a look at the firewall.
Switch it off for a test.
Your problem solution is simple ->
You have to allow external devices to connect your server.
If you are using Wamp Server then look at this post for your answer ->
How to enable local network users to access my WAMP sites?
If you are using Xampp Server then look at this post for your answer ->
Accessing localhost (xampp) from another computer over LAN network - how to?
Hope this solve your problem.

Accessing node.js server on my local system using android app

I have a node.js server running on my local system which interacts with postgresql in the same system to fetch and save data. I want to access node.js server from my android app to save and fetch data from postresql. The problem is my app is not able to connect to localhost. As localhost for my phone is different from my local system and if I am providing my system's IP address then also its refusing the connection.
I made server listen to hostname '0.0.0.0'. Initially I was not providing any hostname as argument in server.listen i.e it was like
server.listen('portnumber') which I changed to
server.listen('portnumber', '0.0.0.0');
if you are using android emulator and trying to access the the host machine's
local host use IP address : 10.0.2.2
for genymotion use IP address: 10.0.2.3
this should allow you to access the host machine's local host, but you will have to change this IP address to local IP address when running app on a device and connected to same network, to access from other network you need to open port(port forwarding I guess) in your router and talk ask your ISP to do the same.
here's a link to similar question : here

Android get connection to sql server

I need to connect to local sql server, but when run code below,
con = DriverManager.getConnection("jdbc:jtds:sqlserver://10.0.3.2:8080/app", "test", "1234");
the logcat display warning message:
06-10 01:24:22.112 2676-2676/com.example.androidapp.helloandroid W/EGL_genymotion﹕ eglSurfaceAttrib not implemented
I dont know what does the warning message means?? I have tried to googled and they recommend use localhost/127.0.0.1/10.0.2.2/10.0.3.2/(local ip address) or remove port number, but it isn't working...
you can not use localHost there should be client server communication. Between a device and server.
So use an ip address remove localHost from url and if you are able to ping that ip from another machine then only we can access it from your android device.

Spring Android Connection Refused ECONNREFUSED

I am trying to make a connection from my Android to my local machine on a wifi network. My machines wifi ip address is 10.27.27.172 and I am running my node.js server on port 7890. I can use my phones chrome browser and browse to my server and access some endpoints which return json. My problem comes when I try and use spring-android rest template. I have given INTERNET permissions to my android application but I still get a ECONNREFUSED error. Is this an android port issue? Is the firewall blocking my request. If so why can I browse to the server but not use the REST client to get the information?
I found the answer on this stackoverflow. You need to make sure you retype the I guess the eclipse editor sometimes adds in invisible characters or something. Anyways it is working now.

Categories

Resources