webee / wamp.js

The Web Application Messaging Protocol for js.
MIT License
6 stars 9 forks source link

When I connect Crossbar.io router say error. React Native #4

Open aaerofeev opened 7 years ago

aaerofeev commented 7 years ago

Crossbar IO Error:

2017-06-02T20:36:05+0600 [Router      92128] Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/autobahn/wamp/websocket.py", line 88, in onMessage
    for msg in self._serializer.unserialize(payload, isBinary):
  File "/usr/local/lib/python2.7/site-packages/autobahn/wamp/serializer.py", line 131, in unserialize
    msg = Klass.parse(raw_msg)
  File "/usr/local/lib/python2.7/site-packages/autobahn/wamp/message.py", line 476, in parse
    raise ProtocolError(u"empty 'roles' in 'details' in HELLO")
ProtocolError: empty 'roles' in 'details' in HELLO

ReactNative out:

06-02 20:35:43.474  3530  3622 I ReactNativeJS: trying to connect.
06-02 20:35:43.484  3530  3622 I ReactNativeJS: trying to create WAMP transport of type: websocket
06-02 20:35:43.484  3530  3622 I ReactNativeJS: using WAMP transport type: websocket

06-02 20:35:43.524  3530  3622 I ReactNativeJS: websocket transport open

06-02 20:35:43.524  3530  3622 I ReactNativeJS: 'send wamp:', [ 1, 'xxx', { roles: {} } ]
06-02 20:35:43.524  3530  3622 I ReactNativeJS: 'WebSocket transport send', '[1,"xxx",{"roles":{}}]'

06-02 20:35:43.534  3530  3622 I ReactNativeJS: 'onclose:', { code: 1002, reason: undefined, wasClean: undefined }
06-02 20:35:43.534  3530  3622 I ReactNativeJS: retrying in 0.9558058601657268 s

ReactNative Code:

wamp.debugOn()

        var connection = new wamp.Connection({
            url: 'ws://127.0.0.1:8080',
            realm: 'xxx'
        })

        connection.onopen = function (session) {
            console.log("connected")
        }

        console.log('Running')

        connection.open()

Crossbar.io: 17.5.1 RN: 0.44 Wamp.js: 0.2.5