Passing arguments on a Connection

#1

Hello

I’m using Autobhan JS with some PHP Routeur & Clients. And I would like to know if it is possible to pass args when connecting to the Routeur. Something like :

var connection = new autobahn.Connection({
url: ‘ws://127.0.0.1:9090/’,
realm: ‘realm1’,
args: {foo: ‘bar’}
});

As there is a meta event in Thruway “onsessionjoin” with 3 arguments : $args, $kwArgs, $options (first args contain Thruway stuffs.)

Thanks

0 Likes

#2

Hi Renaud,

No, you can’t do that actually, but you can send an “initial_payload” event or whatever convenient for you as soon as you are attached to the realm (upon onopen event).

Anyway, if you want to authorize or authenticate your client based on those arguments, you should use a ticket authorizer/authenticator and pass those arguments as a ticket.

Hope it helps you!
Kind regards,

Raito Bezarius.

···

Le lundi 4 mai 2015 13:01:13 UTC+2, Renaud Vizié a écrit :

Hello

I’m using Autobhan JS with some PHP Routeur & Clients. And I would like to know if it is possible to pass args when connecting to the Routeur. Something like :

var connection = new autobahn.Connection({
url: ‘ws://127.0.0.1:9090/’,
realm: ‘realm1’,
args: {foo: ‘bar’}
});

As there is a meta event in Thruway “onsessionjoin” with 3 arguments : $args, $kwArgs, $options (first args contain Thruway stuffs.)

Thanks

0 Likes

#3

Hi Raito

Thanks for your response.
Now, I tried to pass these args in the query string params, and get them in the server onHelloMessage. Nothing ATM, but it will work for sure.
Just discovered the WebSocket world, and it is a strange & beautiful world…

Regards
Renaud

···

Le dimanche 10 mai 2015 19:44:08 UTC+2, Raito Bezarius a écrit :

Hi Renaud,

No, you can’t do that actually, but you can send an “initial_payload” event or whatever convenient for you as soon as you are attached to the realm (upon onopen event).

Anyway, if you want to authorize or authenticate your client based on those arguments, you should use a ticket authorizer/authenticator and pass those arguments as a ticket.

Hope it helps you!
Kind regards,

Raito Bezarius.

Le lundi 4 mai 2015 13:01:13 UTC+2, Renaud Vizié a écrit :

Hello

I’m using Autobhan JS with some PHP Routeur & Clients. And I would like to know if it is possible to pass args when connecting to the Routeur. Something like :

var connection = new autobahn.Connection({
url: ‘ws://127.0.0.1:9090/’,
realm: ‘realm1’,
args: {foo: ‘bar’}
});

As there is a meta event in Thruway “onsessionjoin” with 3 arguments : $args, $kwArgs, $options (first args contain Thruway stuffs.)

Thanks

0 Likes

#4

Hi Renaud,

It can work this way, but pay attention, you’re overwriting implementation details! It may not be the way Autobahn’s developers have planned to do it.

Welcome in the WebSocket world and good luck in your journey !

Kind regards,

Raito Bezarius.

···

Le lundi 11 mai 2015 14:22:28 UTC+2, Renaud Vizié a écrit :

Hi Raito

Thanks for your response.
Now, I tried to pass these args in the query string params, and get them in the server onHelloMessage. Nothing ATM, but it will work for sure.
Just discovered the WebSocket world, and it is a strange & beautiful world…

Regards
Renaud

Le dimanche 10 mai 2015 19:44:08 UTC+2, Raito Bezarius a écrit :

Hi Renaud,

No, you can’t do that actually, but you can send an “initial_payload” event or whatever convenient for you as soon as you are attached to the realm (upon onopen event).

Anyway, if you want to authorize or authenticate your client based on those arguments, you should use a ticket authorizer/authenticator and pass those arguments as a ticket.

Hope it helps you!
Kind regards,

Raito Bezarius.

Le lundi 4 mai 2015 13:01:13 UTC+2, Renaud Vizié a écrit :

Hello

I’m using Autobhan JS with some PHP Routeur & Clients. And I would like to know if it is possible to pass args when connecting to the Routeur. Something like :

var connection = new autobahn.Connection({
url: ‘ws://127.0.0.1:9090/’,
realm: ‘realm1’,
args: {foo: ‘bar’}
});

As there is a meta event in Thruway “onsessionjoin” with 3 arguments : $args, $kwArgs, $options (first args contain Thruway stuffs.)

Thanks

0 Likes

#5

Hi Tobias,

I'm sure you are juggling a million things but just
wanted to point out that your autobahn|python site

http://autobahn.ws/python/

shows "Latest release v0.9.4-2", whereas the PyPI page
it links to from "Downloads" (which has a broken image)
has the latest version, 0.10.4.

Having followed some of your posts to the twisted list,
I am just now on the verge of playing with Autobahn and
WAMP to see if I can use it for an in-house app. Looks
very promising.

Cheers,
Steve

0 Likes

#6

Hi Steve,

thanks for pointing this out. Every little bit helps!

I re-deployed the documentation, so the version number is now correct. I don’t see any broken images - were did you see these?

Glad you find WAMP useful - and feel free to ask any questions which come up!

Regards,

Alex

···

Am Dienstag, 12. Mai 2015 06:31:23 UTC+2 schrieb Stephen Waterbury:

Hi Tobias,

I’m sure you are juggling a million things but just

wanted to point out that your autobahn|python site

http://autobahn.ws/python/

shows “Latest release v0.9.4-2”, whereas the PyPI page

it links to from “Downloads” (which has a broken image)

has the latest version, 0.10.4.

Having followed some of your posts to the twisted list,

I am just now on the verge of playing with Autobahn and

WAMP to see if I can use it for an in-house app. Looks

very promising.

Cheers,

Steve

0 Likes

#7

The broken image was the “downloads/23.7k/month”, but I see it is fixed now!

···

On Tuesday, May 12, 2015 at 6:24:58 AM UTC-4, Alexander Gödde wrote:

Hi Steve,

thanks for pointing this out. Every little bit helps!

I re-deployed the documentation, so the version number is now correct. I don’t see any broken images - were did you see these?

Glad you find WAMP useful - and feel free to ask any questions which come up!

Regards,

Alex

Am Dienstag, 12. Mai 2015 06:31:23 UTC+2 schrieb Stephen Waterbury:

Hi Tobias,

I’m sure you are juggling a million things but just

wanted to point out that your autobahn|python site

http://autobahn.ws/python/

shows “Latest release v0.9.4-2”, whereas the PyPI page

it links to from “Downloads” (which has a broken image)

has the latest version, 0.10.4.

Having followed some of your posts to the twisted list,

I am just now on the verge of playing with Autobahn and

WAMP to see if I can use it for an in-house app. Looks

very promising.

Cheers,

Steve

0 Likes