Comments (5)
@aaugustin
Thanks for your help!
When I modified it to the following code, it started working properly.
I hope it will be helpful to others.
heart-beat:4000,10000 -> heart-beat:0,0
connect_frame = (
'CONNECT\n'
'accept-version:1.2,1.1,1.0\n'
'heart-beat:0,0\n'
f'Authorization:{token}\n'
'\n'
'\x00'
)
from websockets.
The server is closing the connection, as shown here in the log:
DEBUG:websockets.client:< CLOSE 1002 (protocol error) [2 bytes]
Maybe the server logs say why it's closing the connection?
from websockets.
No error found in server logs.Other stomp clients like stompjs connect to the same server work well. After I turned off the server's heartbeat, this error no longer exists.but the connection closed after a few minites.
from websockets.
The server is closing the connection, as shown here in the log:
DEBUG:websockets.client:< CLOSE 1002 (protocol error) [2 bytes]
Maybe the server logs say why it's closing the connection?
server log like this: LoggingWebSocketHandlerDecorator closed with CloseStatus[code=1002, reason=null]
It looks like a protocol error. https://stackoverflow.com/questions/65269411/websocket-closes-with-protocol-error-1002
Can y give me a demo that websockets works over stomp?thanks...
from websockets.
Try adding ping_interval=None
instead of ping_interval=5
. If that works, then the problem could be that the server attempts to UTF-8-decode the payload of pings, which is incorrect — nothing says that ping payloads must be valid UTF-8 — but I've seen that before.
The logs that you posted don't corroborate this theory fully. The first ping payload becomes invalid UTF-8 in the fourth byte, while the second ping payload is invalid at the first byte. Still, the fact that the error happens at a different point might cause different behavior.
>>> b"\x7e\x7e\x1d\x92".decode()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 3: invalid start byte
>>> b"\xc4\xf5\xce\x9a".decode()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 0: invalid continuation byte
Can y give me a demo that websockets works over stomp?
I'm not familiar with STOMP. What I see in the logs is a completely valid WebSocket session. From the perspective of the WebSocket RFC, websockets does the right thing. Really the question is "what does the server dislike?"
from websockets.
Related Issues (20)
- Cannot Send message to a single client.
- handling multiple websocket client connections HOT 4
- Enable to connect ! invalid handshake HOT 7
- recv() is slow HOT 5
- Client state is incorrect HOT 1
- Feature batch receive HOT 2
- [QUESTION] Switching from websocket-client to websockets HOT 1
- Sync version of broadcast HOT 2
- Running Scheduled Task in Websokcets Or Scaling with multiple workers HOT 1
- await websocket.recv() block the coroutine loop. HOT 1
- When using websockets as a client, how to send a pong when receiving a ping? HOT 1
- Make MAX_LINE configurable HOT 5
- When I use websocket to transmit continuous audio pcm data to the server, half of the data is lost HOT 1
- Connection breaks in between during a sustained transfer HOT 9
- When there are N channels in a group, sending a message to the group will be sent N times HOT 1
- Asking for Guidance in Writing a WebsocketHandler for the Python logging Module HOT 3
- iOS and WebSockets: 0 bytes read/no close frame received/code 1006? HOT 5
- question: intended behavior with failed auth and async for auto-reconnect HOT 28
- Clean up tests on PyPy HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websockets.