Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection alternatives #54

Open
veastark opened this issue Jun 30, 2016 · 3 comments
Open

connection alternatives #54

veastark opened this issue Jun 30, 2016 · 3 comments

Comments

@veastark
Copy link

Is it possible to provide connection alternatives, so if one WAMP-Router is unreachable a connection attempt to another is made?

AutobahnJS seems to provide something like this with transports:

transports: [
      {
         'type': 'websocket',
         'url': 'ws://127.0.0.1:9000/ws'
      },
      {
         'type': 'longpoll',
         'url': 'http://127.0.0.1:9000/lp'
      }
   ],

but if I set these options just connection attempts to the first one will be made.

@davidwdan
Copy link
Member

davidwdan commented Jun 30, 2016

@veastark I don't see why that wouldn't work. The options in $wampProvider are passed on to autobhan.

$wampProvider.init({
    transports: [
        {
            'type': 'websocket',
            'url': 'ws://127.0.0.1:9000/ws'
        },
        {
            'type': 'longpoll',
            'url': 'http://127.0.0.1:9000/lp'
        }
    ]
    //Any other AutobahnJS options
});

I'll test this out later today.

@veastark
Copy link
Author

Well if i try it in my code it will only try to connect to the first router:

ESHLApp.config(function ($wampProvider) {    

    $wampProvider.init({
        transports: [
        {
            'type': 'websocket',
            'url': 'ws://xxx:8080/ws'
        },
        {
            'type': 'websocket',
            'url': 'wss://yyy:8888/ws'
        }
        ],
        realm: 'eshl', //real
        //Any other AutobahnJS options
    });
}).run(function ($wamp) {
    $wamp.open();
});

Firefox can't establish a connection to the server at ws://xxx:8080/ws.
http://localhost:34873/resources/scripts/autobahnjs-0.9.5/autobahn.min.js
Line 184
Connection Closed: unreachable Object { retry_delay=1.5649586816915426, retry_count=1, will_retry=true, more...}
angular.min.js (line 453)

@davidwdan
Copy link
Member

Can you provide your crossbar config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants