Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Apr 10, 2024
1 parent 7c9e399 commit 1d3a068
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,16 @@ set_package_fail_file('/tmp/thingsdb-invalid-data.mp')
## WebSockets

Since ThingsDB 1.6 has received WebSocket support. The Python client is able to use the WebSockets protocol by providing the `host` as URI.

For WebSocket connections,the `port` argument will be ignored and must be specified with the URI instead.

Default the `websockets` package is **not included** when installing this connector.

If you want to use WebSockets, make sure to install the package:

```
pip install websockets
```

For example:

```python
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
msgpack>=0.6.2
deprecation
# Optional package:
# websockets
5 changes: 3 additions & 2 deletions thingsdb/client/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ def __init__(
assert type(websockets).__name__ == 'module'
except Exception:
raise ImportError(
'missing module `websockets`; '
'install `websockets` using: \n\n pip install websockets\n\n')
'missing `websockets` module; '
'please install the `websockets` module: '
'\n\n pip install websockets\n\n')
self._proto: WebSocketClientProtocol = None
self._is_closing = False

Expand Down

0 comments on commit 1d3a068

Please sign in to comment.