Need to implement a server-to-client rpc over websocket. Is Autobahn for me ?

#1

I need to be able to execute remote commands from a (hopefully) python server on a android and ios clients.
After some poking around I found that a good solution for me will be invoking rpc over web socket (using the benefits of ssl and bypasing any firewalls).

From what I red I relize that the server-to-client is a bit unusual, Mostly it’s the client that executes the commands in the server.

Because I need to communicate with an sdk embedded in a 3rd party mobile app my main objective is to keep the client as thin and clueless as possible.

I was able to quickly run some of autobahn examples for web sockets.

I wasent able to run autobahn’s basic rpc exmaple (obvisouly, because that’s what I actually need).

I’m getting

Traceback (most recent call last):
File “C:\src\twisted-test\rpc_server.py”, line 39, in
runner.run(Component)
File “C:\Python27\lib\site-packages\autobahn\twisted\wamp.py”, line 245, in run
raise connect_error.exception
twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 10061: No connection could be made because the target machine actively refused it…

``

Tried it on windows 7 and ubuntu 14. Same result.

I would appreciate any help with this,

Haki.

0 Likes

#2

Hi Haki,

I just tried out the example and it works fine for me.

Steps:

  • run Crossbar.io with a default config (you get this by doing crossbar init in a directory where you want the CB config to be)

  • run the “backend.py” (just double-clicking on Windows worked for me)

  • run the “frontend.html” (again, double-clicking)

For me the frontend then connected and got the slow & quicksquare results.

I’m on a current Crossbar.io version (last updated from trunk in the repo a few days ago), and the same goes for Autobahn|Python.

Let me know if the above doesn’t work for you.

Regards,

Alex

···

Am Samstag, 21. März 2015 08:56:12 UTC+1 schrieb Haki Benita:

I need to be able to execute remote commands from a (hopefully) python server on a android and ios clients.
After some poking around I found that a good solution for me will be invoking rpc over web socket (using the benefits of ssl and bypasing any firewalls).

From what I red I relize that the server-to-client is a bit unusual, Mostly it’s the client that executes the commands in the server.

Because I need to communicate with an sdk embedded in a 3rd party mobile app my main objective is to keep the client as thin and clueless as possible.

I was able to quickly run some of autobahn examples for web sockets.

I wasent able to run autobahn’s basic rpc exmaple (obvisouly, because that’s what I actually need).

I’m getting

Traceback (most recent call last):
File “C:\src\twisted-test\rpc_server.py”, line 39, in
runner.run(Component)
File “C:\Python27\lib\site-packages\autobahn\twisted\wamp.py”, line 245, in run
raise connect_error.exception
twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 10061: No connection could be made because the target machine actively refused it…

``

Tried it on windows 7 and ubuntu 14. Same result.

I would appreciate any help with this,

Haki.

0 Likes