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

How to connect to a router, which is not on the same host ?! #39

Closed
manatlan opened this issue Sep 11, 2017 · 3 comments
Closed

How to connect to a router, which is not on the same host ?! #39

manatlan opened this issue Sep 11, 2017 · 3 comments

Comments

@manatlan
Copy link

In all your examples, you make similars connexions like that :

c=Client(router=Crossbar())

But, this works only when the client is on the same host as the router (because it seems it feeds it with the local crossbar config).
I don't have found a way to connect from a different machine ?!
Is it possible with this wampy ?

@noisyboiler
Copy link
Owner

Hi @manatlan
Thanks for your question. I'll add to the docs a more complete example. But yes, it's quite possible. It's all determined by your config of Crossbar.

E.g. http://wampy.readthedocs.io/en/latest/a_wampy_client.html
See the default for localhost configured here: https://github.com/noisyboiler/wampy/blob/master/wampy/peers/routers.py#L19
Which points at what Crossbar.io would consider a default location.
Here is the configuration for localhost: https://github.com/noisyboiler/wampy/blob/master/wampy/testing/configs/crossbar.json#L35

When I get a little time later this week I'll update master and readthedocs and catch up with you to make sure you have had success.

I've tested this myself with an instance of Crossbar running here: http://wampy.online/

Hope this helps. Short answer: It's all in the Crossbar configuration file

@manatlan
Copy link
Author

manatlan commented Sep 11, 2017

But yes, it's quite possible. It's all determined by your config of Crossbar.

Yes, it's all the problem ;-)
My client is on another host, where there is no crossbar config.json at all.

So I try to fake it, by doing something like that :

class Fake:
    pass

c=Fake()
c.host="manatlan.myhost.fr"
c.port=10001
c.realm="realm1"
c.can_use_tls=True
c.url="wss://manatlan.myhost.fr:10001/ws"
c.ipv=4

with Client(router=c) as client:

But, got :

cannot connect to: "wss://manatlan.myhost.fr:10001/ws": no suitable implementation for this system

I'm investigating on that; currently

It could be really cool to have something like the wampy js project, as simple as :

    var client = new Wampy('wss://manatlan.myhost.fr:10001/ws', { realm: "realm1" } )

@noisyboiler
Copy link
Owner

your current error sounds like the python 2.7 issue linked to at the bottom of this PR: #37

will take on board your suggestion.

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