Comments (6)
Based on the line you're mentionning, it seems that websockets is receiving a message aimed at a server when it's configured as a client, or vice versa.
Are you sure you're running a websockets server and not a client? Could you share the code you're using to start your websockets test server?
from websockets.
I basically copy/pasted the code available in the documentation, simply trying to make a echo server:
Something like that:
import asyncio
import websockets
@asyncio.coroutine
def hello(websocket, path):
while True:
message = yield from websocket.recv()
if message is None:
break
yield from websocket.send(message)
start_server = websockets.serve(hello, 'localhost', 8080)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
Then I ran thor with something like "thor --amount 10 --messages 10 ws://localhost:8080"
from websockets.
As far as I can tell, you must use the --masked option of Thor for testing client-to-server connections. I have no idea why this is an option, it's clearly mandatory!
Not checking the mask bit would create a security issue. See https://tools.ietf.org/html/rfc6455#section-5.3. I'm surprised that many implementation ignore it.
Can you give a few examples of implementations you have tested?
from websockets.
I've tried with gevent-websocket, Qt Websocket, websocket.io and node.js websocket. All successfully accepted thor's default mode.
--masked made it work, thanks for taking the time to help with that :)
from websockets.
Excellent.
You can file bugs against these four implementations becase they don't honor https://tools.ietf.org/html/rfc6455#section-5.1:
The server MUST close the connection upon receiving a frame that is not masked.
from websockets.
I just filed a bug against Thor: observing/thor#8
from websockets.
Related Issues (20)
- No route to host----when access IPv6 address failed,no attempt was made to access an IPv4 address HOT 1
- How to close a client connection using the threading interface while stuck in ClientConnection.recv
- Can we get more attention in the threaded client interface? HOT 1
- Human-readable representation of a frame is too short HOT 2
- No module websockets.imports HOT 2
- Sync client stops process exit when running in a Thread if not explicitly closed HOT 5
- Python 3.11 incompatible with websockets\legacy\protocol.py Error "got an unexpected keyword argument 'loop'" HOT 1
- Strange problem, client cannot receive messages from the server, after sending a certain amount of messages. HOT 2
- 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 2
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.