# Socket.IO can not connect

**URL:** <https://discourse.lynckia.com/t/socket-io-can-not-connect/479>\
**Category:** Support\
**Created:** [April 26, 2017, 11:23pm UTC](https://discourse.lynckia.com/t/socket-io-can-not-connect/479 "2017-04-26T23:23:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yozomo](https://avatars.discourse-cdn.com/v4/letter/y/e495f1/32.png) [@yozomo](https://discourse.lynckia.com/u/yozomo)\
**Post date:** [April 26, 2017, 11:23pm UTC](https://discourse.lynckia.com/t/socket-io-can-not-connect/479/1 "2017-04-26T23:23:35Z")

</div>

I’m having a bit of trouble getting [socket.IO](http://socket.IO) to connect.  
I launch the server “./licode/scripts/initLicode.sh” and the example “./scripts/initBasicExample.sh” from the install guide and I can see myself but I get a [socket.io](http://socket.io) error.

 ![](https://canada1.discourse-cdn.com/flex031/uploads/lynckia/original/1X/b721322fbe8303046a967758e3ad6116fa6cb7df.png)

Below is my licode\_config.js not all of it, but the parts I’ve modified. Then below that is my nginx config default.  
I have nginx set up as a reverse proxy for node and [socket.io](http://socket.io)…

I’m not sure what to google search or what where to go an test.  
Please any assistance would be great!

```
/ *********************************************************
 ERIZO CONTROLLER CONFIGURATION
********************************************************** /
config.erizoController = {};

// Use undefined to run clients without Ice Servers
//
// Stun servers format
// {
// "url": url
// }
//
// Turn servers format
// {
// "username": username,
// "credential": password,
// "url": url
// }
config.erizoController.iceServers = [{'url': 'stun:stun.l.google.com:19302'}]; // default value: [{'url': 'stun:stun.l.google.com:19302'}]

// Default and max video bandwidth parameters to be used by clients
config.erizoController.defaultVideoBW = 300; //default value: 300
config.erizoController.maxVideoBW = 300; //default value: 300

// Public erizoController IP for websockets (useful when behind NATs)
// Use '' to automatically get IP from the interface
config.erizoController.publicIP = ''; //default value: ''
config.erizoController.networkinterface = ''; //default value: ''

// This configuration is used by the clients to reach erizoController
// Use '' to use the public IP address instead of a hostname
//config.erizoController.hostname = ''; //default value: ''

config.erizoController.hostname = 'chalkandcheese.co'; //default value: ''

//config.erizoController.port = 8080; //default value: 8080

config.erizoController.port = 8080; //default value: 8080

// Use true if clients communicate with erizoController over SSL
//config.erizoController.ssl = false; //default value: false

config.erizoController.ssl = true; //default value: false

// This configuration is used by erizoController server to listen for connections
// Use true if erizoController listens in HTTPS.
config.erizoController.listen_ssl = false; //default value: false
config.erizoController.listen_port = 8080; //default value: 8080

// Custom location for SSL certificates. Default located in /cert
//config.erizoController.ssl_key = '/full/path/to/ssl.key';
//config.erizoController.ssl_cert = '/full/path/to/ssl.crt';

config.erizoController.ssl_key = '/etc/letsencrypt/live/chalkandcheese.co/privkey.pem';
config.erizoController.ssl_cert = '/etc/letsencrypt/live/chalkandcheese.co/fullchain.pem';

//config.erizoController.sslCaCerts = ['/full/path/to/ca_cert1.crt', '/full/path/to/ca_cert2.crt'];

// Use the name of the inferface you want to bind to for websockets
// config.erizoController.networkInterface = 'eth1' // default value: undefined

```

* * *

```
server {
        listen 80;
        listen [::]:80;
        server_name chalkandcheese.co www.chalkandcheese.co;
        return 301 https://$host$request_uri;
}

server {
        listen 443 ssl spdy;
        listen [::]:443 ssl spdy;
        root /usr/share/nginx/html;
        index index.html index.htm;
        server_name chalkandcheese.co www.chalkandcheese.co;
        ssl on;
        ssl_certificate /etc/letsencrypt/live/chalkandcheese.co/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/chalkandcheese.co/privkey.pem;
        ssl_session_timeout 1d;
        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
        ssl_prefer_server_ciphers on;
        add_header Strict-Transport-Security max-age=15768000;

        location /socket.io {
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_pass "http://localhost:3001/socket.io/";
        }

        location / {
                proxy_pass "http://localhost:3001/";
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
                root /usr/share/nginx/html;
        }

       location ~ /.well-known {
                allow all;
       }
}
```

---

<div class="post-metadata">

**Author:** ![Francesco\_Durighetto](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@Francesco\_Durighetto](https://discourse.lynckia.com/u/Francesco_Durighetto)\
**Post date:** [April 27, 2017, 7:31am UTC](https://discourse.lynckia.com/t/socket-io-can-not-connect/479/2 "2017-04-27T07:31:42Z")

</div>

your socket is trying to connect to :8080 port

> config.erizoController.port = 8080; //default value: 8080

but your nginx is not routing the request in the proper way.  
you are only listening on 443 and 80 ports.
