Skip to content
Advertisement

How can I connect a Python websocket client to my Spring endpoint?

I’m new to Python and I’m trying to connect to a service that I currently have up running in Spring.

On the server-side I have a custom Handshake handler in place by extending DefaultHandshakeHandler and overriding the determineUser method, where I then extract the user information. However, when the request comes in, there is nothing to extract.

What I would like to know is, how do I send this information over with the request?

Here is my basic Python client.

JavaScript

When I run this, I get the following:

JavaScript

It then times out after 60 seconds.

What can I try next?

Advertisement

Answer

I should probably update this.

I was missing the authentication token parameter in the url string.

It works as expected now.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement