Telemachus

Telemachus

14.7k Downloads

WebSocket connection dropping with certain API strings; Python Autobahn client

SavinaRoja opened this issue ยท 2 comments

commented

I am trying to get the hang of websockets and Telemachus, so I have made a prototype client application using Autobahn. It connects successfully and I am able to send at least some messages: sending "{"rate": 2000}" correctly adjusts the message interval from the server to 2 seconds (receiving null message). Here is the current code to demonstrate: https://gist.github.com/SavinaRoja/94682aaaa5a6a69b537c

However attempts to subscribe or run have been unsuccessful and cause the connection to drop citing "connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)". What might be going wrong here?

I have tested this client against a local test websocket server using Autobahn, and on servers both local and internet. The Telemachus version is 1.4.23

commented

Since this is essentially a repeat of this: #20

And is discussed here: #23

I am closing this issue.

commented

I think I have hunted down the problem and I think it has to do with this.

I decided to try using Deedo's RemoteView to see if that websocket client implementation worked and found that it did. After some difficulty, I discerned that if I removed all whitespace from my json string it would work (javascript's JSON does this by default because js is anal about that sort of thing).