Connection dropped when connect from autobahn js

261 views
Skip to first unread message

fossejc

unread,
Jun 17, 2016, 1:46:04 PM6/17/16
to Crossbar
Hi guys,

I have an electron app from which I am trying to connect to a crossbar router. It was working these last days. I updated some packages and since I am not able to connect to the router anymore.

I started a new project to try the basic crossbar example but nothing is working anymore.
I am using autobahn js 0.10.1 with electron 1.2.3. Here is my package.json:

{
  "name": "ProjectName",
  "version": "0.1.0",
  "main": "./main.js",
  "scripts": {
    "start": "electron ."
  },
  "devDependencies": {
    "electron-prebuilt": "^1.2.3"
  },
  "dependencies": {
    "autobahn": "^0.10.0"
  }
}

and main.js

'use strict';


const autobahn = require('autobahn');

console.log("Ok, Autobahn loaded", autobahn.version);
var wp_connection = new autobahn.Connection({
  url: "ws://127.0.0.1:8080/ws",
  realm: "realm1"
});

wp_connection.onopen = function (session) {
  console.log("Wamp socket connected");
}

wp_connection.open();

The config.json

{
    "version": 2,
    "controller": {},
    "workers": [
        {
            "type": "router",
            "realms": [
                {
                    "name": "realm1",
                    "roles": [
                        {
                            "name": "anonymous",
                            "permissions": [
                                {
                                    "uri": "*",
                                    "allow": {
                                        "call": true,
                                        "register": true,
                                        "publish": true,
                                        "subscribe": true
                                    },
                                    "disclose": {
                                        "caller": false,
                                        "publisher": false
                                    },
                                    "cache": true
                                }
                            ]
                        }
                    ]
                }
            ],
            "transports": [
                {
                    "type": "web",
                    "endpoint": {
                        "type": "tcp",
                        "port": 8080
                    },
                    "paths": {
                        "/": {
                            "type": "static",
                            "directory": ".."
                        },
                        "wp": {
                            "type": "websocket"
                        }
                    }
                }
            ]
        }
    ]
}


I got the following debug message from crossbar :

2016-06-17T19:22:42+0200 [Router       1550 crossbar.router.session.RouterSession] Client session connected - transport: {u'cbtid': None, u'protocol': 'wamp.2.json', u'http_headers_received': {u'upgrade': u'websocket', u'sec-websocket-extensions': u'permessage-deflate; client_max_window_bits', u'sec-websocket-version': u'13', u'sec-websocket-protocol': u'wamp.2.json', u'connection': u'Upgrade', u'sec-websocket-key': u'MTMtMTQ2NjE4NDE2MjI3MQ==', u'host': u'127.0.0.1:8080'}, u'peer': u'tcp4:127.0.0.1:52295', u'http_headers_sent': {}, u'type': 'websocket'}

2016-06-17T19:22:42+0200 [Router       1550 crossbar.router.protocol.WampWebSocketServerProtocol] dropping connection: None

2016-06-17T19:22:42+0200 [Router       1550 crossbar.router.protocol.WampWebSocketServerProtocol] Connection to/from tcp4:127.0.0.1:52295 was closed cleanly

2016-06-17T19:22:42+0200 [Router       1550 crossbar.router.protocol.WampWebSocketServerProtocol] _connectionLost: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.

]


So basically I am able to connect to the router but them the connection is directly closed. However, the same code is working in the browser.
I could use some help on this one. Any ideas ?

Do you need other informations ?

Thank you all

Alexander Gödde

unread,
Jun 18, 2016, 5:02:48 AM6/18/16
to Crossbar
Hi!

As is, I can't say anything about where the problem lies.

What packages did you update? I would suggest going back to your last working configuration, update the packages individually and check whether things are still working after each update. Once it's clear what causes the problem (or which combination of things) we can take a closer look.

Regards,

Alex

fossejc

unread,
Jun 18, 2016, 5:44:07 AM6/18/16
to Crossbar
I did try with all the old packages version except electron. I just tried it now and it seems to be related to electron v1.2.0 as it is working with electron v1.1.3. 

Thank for your help
Best
JC
Reply all
Reply to author
Forward
0 new messages