I’m pretty new to the whole websocket topic, so I might be overlooking something. I’m having issues to connect my local Python program, which is using autobahn-python, to crossbar running in a Docker container.
I started crossbar in docker
(cd crossbar-examples/getting-started && docker run -v $PWD:/node -u 0 --rm --name=crossbar -it -p 8080:8080 crossbario/crossbar)
and have the port binding on localhost:8080 which I can verify using the browser on http://localhost:8080/ws
and using websocat ws://localhost:8080/ws
(giving a protocol handshake error).
I can run the example in docker using
(cd crossbar-examples/getting-started && docker run -v $PWD:/app -e CBURL="ws://crossbar:8080/ws" -e CBREALM="realm1" --link=crossbar --rm -it crossbario/autobahn-python:cpy3 python /app/1.hello-world/client_component_publish.py)
which results in a successful connect. However, when I run the same script im my local Python env and replace the hostname with localhost, it seems to have the same connection issue as with my own program.
CBURL="ws://localhost:8080/ws" CBREALM="realm1" python /tmp/crossbar-examples/getting-started/1.hello-world/client_component_publish.py
ws://localhost:8080/ws realm1
2023-08-23T12:56:44+0200 trying transport 0 ("ws://localhost:8080/ws") using connect delay 0
2023-08-23T12:56:44+0200 connecting once using transport type "websocket" over endpoint "tcp"
2023-08-23T12:56:44+0200 Connection failed: RuntimeError: could not create serializer for "cbor" (available: ['json', 'msgpack'])
2023-08-23T12:56:44+0200 trying transport 0 ("ws://localhost:8080/ws") using connect delay 2.407089595488867
2023-08-23T12:56:46+0200 connecting once using transport type "websocket" over endpoint "tcp"
2023-08-23T12:56:46+0200 Connection failed: RuntimeError: could not create serializer for "cbor" (available: ['json', 'msgpack'])
2023-08-23T12:56:46+0200 trying transport 0 ("ws://localhost:8080/ws") using connect delay 3.501851843882228
^C2023-08-23T12:56:47+0200 Received SIGINT, shutting down.
What am I missing here?