Can't connect on local server

ka_lin

I am developing an app in ionic and I can't connect to the socket server when running on a device.

I have managed to connect my app (port:8100) to a node server(port:9000) locally when developing (via ionic serve), I don have a cors issue, everything runs fine.

Client looks something like this :

socket = new io.connect('http://192.168.1.106:9000');
socket.on('reconnect_attempt',function() {
      alert('crap');
});

P.S: the above code is from my own memory, but I know I have provided the ip and port

If the server is working or not I still get the alert...

I have also checked the manifest of the app and it has the appropriate permissions: android.permission.INTERNET

I also added a js error handler to check if there is a js error:

window.onerror = function (errorMsg, url, lineNumber) {
    alert(errorMsg);
}
var MyApp = angular.module('scotch-todo', ['ionic']);
...

I had a small error and fixed it (so the handler works) but now nothing is catched...

kaeedo

If I understand correctly, you can connect when developing on your PC, but now when testing on your physical device.

Since Cordova v4, they changed the default behavior so it won't connect to any address outside its own WebView pages. There exists a cordova whitelist plugin that lets you connect to a list of address in the whitelist

http://docs.ionic.io/docs/cordova-whitelist

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't connect to local MySQL server

From Dev

apache - Can't connect to apache local server between ubuntu and android

From Dev

"Can't connect to local MySQL server" in docker-compose

From Dev

PrincipalContext - I Can't connect to a local openldap server

From Dev

I can't connect to test a local server started with TcpListener

From Dev

PHP can't connect to local MariaDB server using TCP

From Dev

Can't connect to rumpus server via local IP on macbook pro

From Dev

Can't connect to local Sql Server while connected to a VPN

From Dev

Can't connect to web-server on local host behind NAT

From Dev

Why it can't connect to local mysql server due ERROR 2002?

From Dev

Can't connect local server by public domain name

From Dev

tcp client can't connect to local server randomly in unity

From Dev

Minecraft for Windows 10 can't connect to local server on LAN

From Dev

Can't connect to local MySQL server through socket

From Dev

"Can't connect to local MySQL server" in docker-compose

From Dev

Can't connect to local Datastore

From Dev

SQL Server 2014- can't connect to local db - can not find server

From Dev

Sql Server 2014 - Update to windows 10 and can't connect to the Local Server

From Dev

Can't connect local network VNC server when OpenVPN client is connected on this server

From Dev

Ubuntu Server can access the internet, but I can't connect to it on the local network

From Dev

Can't connect to local SQL Server DB with connection string, but VS can

From Dev

Ubuntu Server can access the internet, but I can't connect to it on the local network

From Dev

How can I connect an android with a local server?

From Dev

Can't connect to nodejs server

From Dev

Can't connect to Postgres server

From Dev

Can't connect to noVNC server

From Dev

Can't connect to Postgres server

From Dev

Can't connect to linked server

From Dev

SQL Server 2008 R2 can't connect to local database in Management Studio

Related Related

  1. 1

    Can't connect to local MySQL server

  2. 2

    apache - Can't connect to apache local server between ubuntu and android

  3. 3

    "Can't connect to local MySQL server" in docker-compose

  4. 4

    PrincipalContext - I Can't connect to a local openldap server

  5. 5

    I can't connect to test a local server started with TcpListener

  6. 6

    PHP can't connect to local MariaDB server using TCP

  7. 7

    Can't connect to rumpus server via local IP on macbook pro

  8. 8

    Can't connect to local Sql Server while connected to a VPN

  9. 9

    Can't connect to web-server on local host behind NAT

  10. 10

    Why it can't connect to local mysql server due ERROR 2002?

  11. 11

    Can't connect local server by public domain name

  12. 12

    tcp client can't connect to local server randomly in unity

  13. 13

    Minecraft for Windows 10 can't connect to local server on LAN

  14. 14

    Can't connect to local MySQL server through socket

  15. 15

    "Can't connect to local MySQL server" in docker-compose

  16. 16

    Can't connect to local Datastore

  17. 17

    SQL Server 2014- can't connect to local db - can not find server

  18. 18

    Sql Server 2014 - Update to windows 10 and can't connect to the Local Server

  19. 19

    Can't connect local network VNC server when OpenVPN client is connected on this server

  20. 20

    Ubuntu Server can access the internet, but I can't connect to it on the local network

  21. 21

    Can't connect to local SQL Server DB with connection string, but VS can

  22. 22

    Ubuntu Server can access the internet, but I can't connect to it on the local network

  23. 23

    How can I connect an android with a local server?

  24. 24

    Can't connect to nodejs server

  25. 25

    Can't connect to Postgres server

  26. 26

    Can't connect to noVNC server

  27. 27

    Can't connect to Postgres server

  28. 28

    Can't connect to linked server

  29. 29

    SQL Server 2008 R2 can't connect to local database in Management Studio

HotTag

Archive