Websocket Server for python
Project description
Python Package for Websocket Server Live
WebsocketServer built in python.
For active server on command line:
- Install package with PIP;
- Run command wsserver-malbizer 'port_value_numerical'
- Send JSON string for serve on model:
{
"subject": "subject for your message",
"sender": "id_sender",
"topic": [], //List of topics to inscribe message
"payload": "Value for your message (JSON string)",
"persist": false //indicate if message is persisted and send for new clients
}
For using on python file:
- Import wsservermalbizer with WebsocketServer and use the code:
WebSocketServer(port=port).start()
For use Client (command-line):
- Run command (if port_value_numerical is 7135):
wsclient-malbizer "ws://localhost:7135" "topic"
- watch for messages on server websocket;
For use Message Sender (command-line):
- Run command (if port_value_numerical is 7135):
wssend-malbizer "ws://localhost:7135" "payload" "subject" "user" "topics,separed,with,comma"
- await command send for server;
For use Client (python file):
- Import wsservermalbizer with WebsocketClientReceiver and use the code (if port_value_numerical is 7135):
WebsocketClientReceiver("ws://localhost:7135","topics,separed,with,comma,for,subscribe").receiver()
For use Message Sender (python file):
- Import wsservermalbizer with WebsocketClientReceiver and use the code (if port_value_numerical is 7135):
client = WebsocketClientMessage()
client.sender = "user"
client.subject = "subject"
client.payload = "payload JSON"
client.topics = ["topics","to","send"]
client.persist = False //True if you need persistance
sender = WebsocketClientSender(client, "ws://localhost:7135")
sender.send()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wsserver_malbizer-1.0.6.tar.gz
.
File metadata
- Download URL: wsserver_malbizer-1.0.6.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3adb24798a2547b4c95faf45d2e64e374ff0836034f46997492b477bea05df3c |
|
MD5 | a567ebca1d633224420456af4ee2cc59 |
|
BLAKE2b-256 | 4407d74855dc72cfda553a2b485d83f0980adc16564bca10adc2b6b0f26e5e7c |
File details
Details for the file wsserver_malbizer-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: wsserver_malbizer-1.0.6-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c164d29937035a281d1cacfc972dedeac641c5ef846a0e25b865956f5e0719ee |
|
MD5 | cec6e327eb66bee2940a660c18bcee14 |
|
BLAKE2b-256 | 09c63a025c0b8049d92e44b6756bbdb8e247a17fc87b009c4cb3bdf6cf290219 |